#if !defined(_WIN32)
#define ROOT "root"
-static int root_uids[] = { 0 };
-static int root_gids[] = { 0, 1 };
+static const int root_uids[] = { 0 };
+static const int root_gids[] = { 0, 1 };
#elif defined(__CYGWIN__)
/* On cygwin, the Administrator user most likely exists (unless
* it has been renamed or is in a non-English localization), but
* Use CreateWellKnownSID() and LookupAccountName()?
*/
#define ROOT "Administrator"
-static int root_uids[] = { 500 };
-static int root_gids[] = { 513, 545, 544 };
+static const int root_uids[] = { 500 };
+static const int root_gids[] = { 513, 545, 544 };
#endif
#if defined(ROOT)
static int
-int_in_list(int i, int *l, size_t n)
+int_in_list(int i, const int *l, size_t n)
{
while (n-- > 0)
if (*l++ == i)
int error;
};
-static int slots[] = {
+static const int slots[] = {
30, 32, 34, 36, 38, 42, 50, 66, 98, 162, 290
};
#define SLOT_BASE 15
#define CFDATA_cbData 4
#define CFDATA_cbUncomp 6
-static char *compression_name[] = {
+static const char *compression_name[] = {
"NONE",
"MSZIP",
"Quantum",
if (datasize >= 2) {
lha->header_crc = archive_le16dec(extdheader);
if (crc != NULL) {
- static char zeros[2] = {0, 0};
+ static const char zeros[2] = {0, 0};
*crc = lha_crc16(*crc, h,
extdsize - datasize);
/* CRC value itself as zero */
static int
_utf8_to_unicode(uint32_t *pwc, const char *s, size_t n)
{
- static char utf8_count[256] = {
+ static const char utf8_count[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
* code in turn. When the buffer fills up empty it and start over.
*/
-static unsigned char rmask[9] =
+static const unsigned char rmask[9] =
{0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff};
static int
static int
_utf8_to_unicode(uint32_t *pwc, const char *s, size_t n)
{
- static char utf8_count[256] = {
+ static const char utf8_count[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */