summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2013-02-02 03:08:57 +0100
committerrofl0r <retnyg@gmx.net>2013-02-02 03:19:25 +0100
commitc50925071cce9c6342597f5671e30d2970c6ff4a (patch)
tree32279f7c94dfb0b2b76c4eaed3880247a45a7adf /src
parentfacc6acbfd20accea435d10fdd070b23877e40db (diff)
downloadmusl-c50925071cce9c6342597f5671e30d2970c6ff4a.tar.gz
make some arrays const
this way they'll go into .rodata, decreasing memory pressure.
Diffstat (limited to 'src')
-rw-r--r--src/crypt/crypt_md5.c2
-rw-r--r--src/crypt/crypt_sha256.c2
-rw-r--r--src/crypt/crypt_sha512.c2
-rw-r--r--src/ctype/iswalpha.c2
-rw-r--r--src/ctype/iswpunct.c2
-rw-r--r--src/ctype/wcwidth.c4
-rw-r--r--src/time/__tm_to_time.c2
7 files changed, 8 insertions, 8 deletions
diff --git a/src/crypt/crypt_md5.c b/src/crypt/crypt_md5.c
index 70ab8b99..6e75b36c 100644
--- a/src/crypt/crypt_md5.c
+++ b/src/crypt/crypt_md5.c
@@ -182,7 +182,7 @@ static void md5_update(struct md5 *s, const void *m, unsigned long len)
#define KEY_MAX 30000
#define SALT_MAX 8
-static unsigned char b64[] =
+static const unsigned char b64[] =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static char *to64(char *s, unsigned int u, int n)
diff --git a/src/crypt/crypt_sha256.c b/src/crypt/crypt_sha256.c
index e01a208b..d5f0b786 100644
--- a/src/crypt/crypt_sha256.c
+++ b/src/crypt/crypt_sha256.c
@@ -153,7 +153,7 @@ static void sha256_update(struct sha256 *s, const void *m, unsigned long len)
memcpy(s->buf, p, len);
}
-static unsigned char b64[] =
+static const unsigned char b64[] =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static char *to64(char *s, unsigned int u, int n)
diff --git a/src/crypt/crypt_sha512.c b/src/crypt/crypt_sha512.c
index 8325d77c..1294e98b 100644
--- a/src/crypt/crypt_sha512.c
+++ b/src/crypt/crypt_sha512.c
@@ -174,7 +174,7 @@ static void sha512_update(struct sha512 *s, const void *m, unsigned long len)
memcpy(s->buf, p, len);
}
-static unsigned char b64[] =
+static const unsigned char b64[] =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static char *to64(char *s, unsigned int u, int n)
diff --git a/src/ctype/iswalpha.c b/src/ctype/iswalpha.c
index 4007c8a6..d558faef 100644
--- a/src/ctype/iswalpha.c
+++ b/src/ctype/iswalpha.c
@@ -1,6 +1,6 @@
#include <wctype.h>
-static unsigned char table[] = {
+static const unsigned char table[] = {
#include "alpha.h"
};
diff --git a/src/ctype/iswpunct.c b/src/ctype/iswpunct.c
index a8297452..16e8703b 100644
--- a/src/ctype/iswpunct.c
+++ b/src/ctype/iswpunct.c
@@ -1,6 +1,6 @@
#include <wctype.h>
-static unsigned char table[] = {
+static const unsigned char table[] = {
#include "punct.h"
};
diff --git a/src/ctype/wcwidth.c b/src/ctype/wcwidth.c
index 98f128e9..49c40eea 100644
--- a/src/ctype/wcwidth.c
+++ b/src/ctype/wcwidth.c
@@ -1,10 +1,10 @@
#include <wchar.h>
-static unsigned char table[] = {
+static const unsigned char table[] = {
#include "nonspacing.h"
};
-static unsigned char wtable[] = {
+static const unsigned char wtable[] = {
#include "wide.h"
};
diff --git a/src/time/__tm_to_time.c b/src/time/__tm_to_time.c
index 3b1140b6..9f11805d 100644
--- a/src/time/__tm_to_time.c
+++ b/src/time/__tm_to_time.c
@@ -26,7 +26,7 @@ time_t __tm_to_time(struct tm *tm)
z100 = Q(z4, 25);
z400 = Q(z100, 4);
day += year*365 + z4 - z100 + z400 +
- month[(int []){0,31,59,90,120,151,181,212,243,273,304,334}];
+ month[(const int []){0,31,59,90,120,151,181,212,243,273,304,334}];
return (long long)day*86400
+ tm->tm_hour*3600 + tm->tm_min*60 + tm->tm_sec
- -946684800; /* the dawn of time :) */