Index: modules/libreg/include/NSReg.h =================================================================== RCS file: /cvsroot/mozilla/modules/libreg/include/NSReg.h,v retrieving revision 3.30 diff -u -r3.30 NSReg.h --- modules/libreg/include/NSReg.h 22 May 2006 19:13:03 -0000 3.30 +++ modules/libreg/include/NSReg.h 14 Sep 2006 06:56:08 -0000 @@ -280,7 +280,7 @@ VR_INTERFACE(REGERR) NR_RegAddKey( HREG hReg, /* handle of open registry */ RKEY key, /* root key */ - char *path, /* relative path of subkey to add */ + const char *path, /* relative path of subkey to add */ RKEY *newKey /* if not null returns newly created key */ ); @@ -303,7 +303,7 @@ VR_INTERFACE(REGERR) NR_RegAddKeyRaw( HREG hReg, /* handle of open registry */ RKEY key, /* root key */ - char *keyname, /* name of key to add */ + const char *keyname, /* name of key to add */ RKEY *newKey /* if not null returns newly created key */ ); @@ -325,7 +325,7 @@ VR_INTERFACE(REGERR) NR_RegDeleteKey( HREG hReg, /* handle of open registry */ RKEY key, /* root key */ - char *path /* relative path of subkey to delete */ + const char *path /* relative path of subkey to delete */ ); @@ -344,7 +344,7 @@ VR_INTERFACE(REGERR) NR_RegDeleteKeyRaw( HREG hReg, /* handle of open registry */ RKEY key, /* root key */ - char *keyname /* name subkey to delete */ + const char *keyname /* name subkey to delete */ ); @@ -433,7 +433,7 @@ VR_INTERFACE(REGERR) NR_RegGetEntryInfo( HREG hReg, /* handle of open registry */ RKEY key, /* containing key */ - char *name, /* entry name */ + const char *name, /* entry name */ REGINFO *info /* returned entry info */ ); @@ -453,7 +453,7 @@ VR_INTERFACE(REGERR) NR_RegGetEntryString( HREG hReg, /* handle of open registry */ RKEY key, /* containing key */ - char *name, /* entry name */ + const char *name, /* entry name */ char *buffer, /* buffer to hold value (UTF String) */ uint32 bufsize /* length of buffer */ ); @@ -474,7 +474,7 @@ VR_INTERFACE(REGERR) NR_RegGetEntry( HREG hReg, /* handle of open registry */ RKEY key, /* containing key */ - char *name, /* entry name */ + const char *name, /* entry name */ void *buffer, /* buffer to hold value */ uint32 *size /* in:length of buffer */ ); /* out: data length, >>includes<< null terminator*/ @@ -495,7 +495,7 @@ VR_INTERFACE(REGERR) NR_RegSetEntryString( HREG hReg, /* handle of open registry */ RKEY key, /* containing key */ - char *name, /* entry name */ + const char *name, /* entry name */ char *buffer /* UTF String value */ ); @@ -516,7 +516,7 @@ VR_INTERFACE(REGERR) NR_RegSetEntry( HREG hReg, /* handle of open registry */ RKEY key, /* containing key */ - char *name, /* entry name */ + const char *name, /* entry name */ uint16 type, /* type of value data */ void *buffer, /* data buffer */ uint32 size /* data length in bytes; incl. null term for strings */ @@ -535,7 +535,7 @@ VR_INTERFACE(REGERR) NR_RegDeleteEntry( HREG hReg, /* handle of open registry */ RKEY key, /* containing key */ - char *name /* value name */ + const char *name /* value name */ ); Index: modules/libreg/src/reg.c =================================================================== RCS file: /cvsroot/mozilla/modules/libreg/src/reg.c,v retrieving revision 3.64 diff -u -r3.64 reg.c --- modules/libreg/src/reg.c 11 May 2004 12:15:10 -0000 3.64 +++ modules/libreg/src/reg.c 14 Sep 2006 06:56:11 -0000 @@ -439,7 +439,7 @@ static REGERR nr_OpenFile(const char *path, FILEHANDLE *fh); static REGERR nr_CloseFile(FILEHANDLE *fh); /* Note: fh is a pointer */ static REGERR nr_ReadFile(FILEHANDLE fh, REGOFF offset, int32 len, void *buffer); -static REGERR nr_WriteFile(FILEHANDLE fh, REGOFF offset, int32 len, void *buffer); +static REGERR nr_WriteFile(FILEHANDLE fh, REGOFF offset, int32 len, const void *buffer); static REGERR nr_LockRange(FILEHANDLE fh, REGOFF offset, int32 len); static REGERR nr_UnlockRange(FILEHANDLE fh, REGOFF offset, int32 len); static int32 nr_GetFileLength(FILEHANDLE fh); @@ -602,7 +602,7 @@ -static REGERR nr_WriteFile(FILEHANDLE fh, REGOFF offset, int32 len, void *buffer) +static REGERR nr_WriteFile(FILEHANDLE fh, REGOFF offset, int32 len, const void *buffer) { /* Note: 'offset' will commonly be the end of the file, in which @@ -674,15 +674,15 @@ * The buffers *MUST* be the appropriate size! * -------------------------------------------------------------------- */ -static uint32 nr_ReadLong(char *buffer); -static uint16 nr_ReadShort(char *buffer); +static uint32 nr_ReadLong(const char *buffer); +static uint16 nr_ReadShort(const char *buffer); static void nr_WriteLong(uint32 num, char *buffer); static void nr_WriteShort(uint16 num, char *buffer); /* -------------------------------------------------------------------- */ -static uint16 nr_ReadShort(char *buffer) +static uint16 nr_ReadShort(const char *buffer) { uint16 val; uint8 *p = (uint8*)buffer; @@ -694,7 +694,7 @@ -static uint32 nr_ReadLong(char *buffer) +static uint32 nr_ReadLong(const char *buffer) { uint32 val; uint8 *p = (uint8*)buffer; @@ -749,15 +749,15 @@ static REGERR nr_ReadData(REGFILE *reg, REGDESC *desc, uint32 buflen, char *buf); static REGERR nr_WriteDesc(REGFILE *reg, REGDESC *desc); /* writes a desc */ -static REGERR nr_WriteString(REGFILE *reg, char *string, REGDESC *desc); /* writes a string */ -static REGERR nr_WriteData(REGFILE *reg, char *string, uint32 len, REGDESC *desc); /* writes a string */ +static REGERR nr_WriteString(REGFILE *reg, const char *string, REGDESC *desc); /* writes a string */ +static REGERR nr_WriteData(REGFILE *reg, const char *string, uint32 len, REGDESC *desc); /* writes a string */ static REGERR nr_AppendDesc(REGFILE *reg, REGDESC *desc, REGOFF *result); /* adds a desc */ -static REGERR nr_AppendName(REGFILE *reg, char *name, REGDESC *desc); /* adds a name */ -static REGERR nr_AppendString(REGFILE *reg, char *string, REGDESC *desc); /* adds a string */ -static REGERR nr_AppendData(REGFILE *reg, char *string, uint32 len, REGDESC *desc); /* adds a string */ +static REGERR nr_AppendName(REGFILE *reg, const char *name, REGDESC *desc); /* adds a name */ +static REGERR nr_AppendString(REGFILE *reg, const char *string, REGDESC *desc); /* adds a string */ +static REGERR nr_AppendData(REGFILE *reg, const char *string, uint32 len, REGDESC *desc); /* adds a string */ -static XP_Bool nr_IsValidUTF8(char *string); /* checks if a string is UTF-8 encoded */ +static XP_Bool nr_IsValidUTF8(const char *string); /* checks if a string is UTF-8 encoded */ /* -------------------------------------------------------------------- */ @@ -1119,11 +1119,11 @@ -static REGERR nr_AppendName(REGFILE *reg, char *name, REGDESC *desc) +static REGERR nr_AppendName(REGFILE *reg, const char *name, REGDESC *desc) { REGERR err; int len; - char *p; + const char *p; XP_ASSERT(reg); XP_ASSERT(name); @@ -1169,7 +1169,7 @@ -static REGERR nr_WriteString(REGFILE *reg, char *string, REGDESC *desc) +static REGERR nr_WriteString(REGFILE *reg, const char *string, REGDESC *desc) { uint32 len; @@ -1186,7 +1186,7 @@ -static REGERR nr_WriteData(REGFILE *reg, char *string, uint32 len, REGDESC *desc) +static REGERR nr_WriteData(REGFILE *reg, const char *string, uint32 len, REGDESC *desc) { REGERR err; @@ -1221,7 +1221,7 @@ -static REGERR nr_AppendString(REGFILE *reg, char *string, REGDESC *desc) +static REGERR nr_AppendString(REGFILE *reg, const char *string, REGDESC *desc) { uint32 len; @@ -1238,7 +1238,7 @@ -static REGERR nr_AppendData(REGFILE *reg, char *string, uint32 len, REGDESC *desc) +static REGERR nr_AppendData(REGFILE *reg, const char *string, uint32 len, REGDESC *desc) { REGERR err; @@ -1274,10 +1274,10 @@ } /* nr_AppendData */ -static XP_Bool nr_IsValidUTF8(char *string) +static XP_Bool nr_IsValidUTF8(const char *string) { int follow = 0; - char *c; + const char *c; unsigned char ch; XP_ASSERT(string); @@ -1535,10 +1535,10 @@ REGDESC *pDesc, REGOFF *pOffPrev); static REGERR nr_CreateSubKey(REGFILE *reg, REGOFF parent, REGDESC *pDesc, - char *name); + const char *name); static REGERR nr_CreateEntryString(REGFILE *reg, REGDESC *pParent, - char *name, char *value); -static REGERR nr_CreateEntry(REGFILE *reg, REGDESC *pParent, char *name, + const char *name, char *value); +static REGERR nr_CreateEntry(REGFILE *reg, REGDESC *pParent, const char *name, uint16 type, char *buffer, uint32 length); /* -------------------------------------------------------------------- */ @@ -1690,7 +1690,7 @@ static REGERR nr_CreateSubKey(REGFILE *reg, REGOFF parent, REGDESC *pDesc, - char *name) + const char *name) { /* nr_CreateSubKey does NO error checking--callers *MUST* * ensure that there are no duplicates @@ -1736,7 +1736,7 @@ -static REGERR nr_CreateEntryString(REGFILE *reg, REGDESC *pParent, char *name, char *value) +static REGERR nr_CreateEntryString(REGFILE *reg, REGDESC *pParent, const char *name, char *value) { REGDESC desc; REGERR err; @@ -1773,7 +1773,7 @@ -static REGERR nr_CreateEntry(REGFILE *reg, REGDESC *pParent, char *name, +static REGERR nr_CreateEntry(REGFILE *reg, REGDESC *pParent, const char *name, uint16 type, char *value, uint32 length) { REGDESC desc; @@ -1819,8 +1819,8 @@ static REGOFF nr_TranslateKey( REGFILE *reg, RKEY key ); static REGERR nr_InitStdRkeys( REGFILE *reg ); static XP_Bool nr_ProtectedNode( REGFILE *reg, REGOFF key ); -static REGERR nr_RegAddKey( REGFILE *reg, RKEY key, char *path, RKEY *newKey, XP_Bool raw ); -static REGERR nr_RegDeleteKey( REGFILE *reg, RKEY key, char *path, XP_Bool raw ); +static REGERR nr_RegAddKey( REGFILE *reg, RKEY key, const char *path, RKEY *newKey, XP_Bool raw ); +static REGERR nr_RegDeleteKey( REGFILE *reg, RKEY key, const char *path, XP_Bool raw ); static REGERR nr_RegOpen( const char *filename, HREG *hReg ); static REGERR nr_RegClose( HREG hReg ); static char* nr_GetUsername(); @@ -1968,14 +1968,14 @@ -static REGERR nr_RegAddKey( REGFILE *reg, RKEY key, char *path, RKEY *newKey, XP_Bool raw ) +static REGERR nr_RegAddKey( REGFILE *reg, RKEY key, const char *path, RKEY *newKey, XP_Bool raw ) { REGERR err; REGDESC desc; REGOFF start; REGOFF parent; char namebuf[MAXREGNAMELEN]; - char *p; + const char *p; XP_ASSERT( regStartCount > 0 ); XP_ASSERT( reg != NULL ); @@ -2044,7 +2044,7 @@ -static REGERR nr_RegDeleteKey( REGFILE *reg, RKEY key, char *path, XP_Bool raw ) +static REGERR nr_RegDeleteKey( REGFILE *reg, RKEY key, const char *path, XP_Bool raw ) { REGERR err; REGOFF start; @@ -2629,7 +2629,7 @@ * nodes will also be added if necessary. * --------------------------------------------------------------------- */ -VR_INTERFACE(REGERR) NR_RegAddKey( HREG hReg, RKEY key, char *path, RKEY *newKey ) +VR_INTERFACE(REGERR) NR_RegAddKey( HREG hReg, RKEY key, const char *path, RKEY *newKey ) { REGERR err; REGOFF start; @@ -2687,7 +2687,7 @@ * newkey - if not null the RKEY of the new key is returned * --------------------------------------------------------------------- */ -VR_INTERFACE(REGERR) NR_RegAddKeyRaw( HREG hReg, RKEY key, char *keyname, RKEY *newKey ) +VR_INTERFACE(REGERR) NR_RegAddKeyRaw( HREG hReg, RKEY key, const char *keyname, RKEY *newKey ) { REGERR err; REGOFF start; @@ -2744,7 +2744,7 @@ * path - relative path of key to delete * --------------------------------------------------------------------- */ -VR_INTERFACE(REGERR) NR_RegDeleteKey( HREG hReg, RKEY key, char *path ) +VR_INTERFACE(REGERR) NR_RegDeleteKey( HREG hReg, RKEY key, const char *path ) { REGERR err; REGFILE* reg; @@ -2782,7 +2782,7 @@ * keyname - name of child key to delete * --------------------------------------------------------------------- */ -VR_INTERFACE(REGERR) NR_RegDeleteKeyRaw( HREG hReg, RKEY key, char *keyname ) +VR_INTERFACE(REGERR) NR_RegDeleteKeyRaw( HREG hReg, RKEY key, const char *keyname ) { REGERR err; REGFILE* reg; @@ -2940,7 +2940,7 @@ * info - return: Entry info object * --------------------------------------------------------------------- */ -VR_INTERFACE(REGERR) NR_RegGetEntryInfo( HREG hReg, RKEY key, char *name, +VR_INTERFACE(REGERR) NR_RegGetEntryInfo( HREG hReg, RKEY key, const char *name, REGINFO *info ) { REGERR err; @@ -3006,7 +3006,7 @@ * bufsize - size of buffer * --------------------------------------------------------------------- */ -VR_INTERFACE(REGERR) NR_RegGetEntryString( HREG hReg, RKEY key, char *name, +VR_INTERFACE(REGERR) NR_RegGetEntryString( HREG hReg, RKEY key, const char *name, char *buffer, uint32 bufsize) { REGERR err; @@ -3072,7 +3072,7 @@ * out: size of actual data (incl. \0 term. for strings) * --------------------------------------------------------------------- */ -VR_INTERFACE(REGERR) NR_RegGetEntry( HREG hReg, RKEY key, char *name, +VR_INTERFACE(REGERR) NR_RegGetEntry( HREG hReg, RKEY key, const char *name, void *buffer, uint32 *size ) { REGERR err; @@ -3205,7 +3205,7 @@ * buffer - UTF-8 String to store * --------------------------------------------------------------------- */ -VR_INTERFACE(REGERR) NR_RegSetEntryString( HREG hReg, RKEY key, char *name, +VR_INTERFACE(REGERR) NR_RegSetEntryString( HREG hReg, RKEY key, const char *name, char *buffer ) { REGERR err; @@ -3274,7 +3274,7 @@ * size - length of data to store in bytes * --------------------------------------------------------------------- */ -VR_INTERFACE(REGERR) NR_RegSetEntry( HREG hReg, RKEY key, char *name, uint16 type, +VR_INTERFACE(REGERR) NR_RegSetEntry( HREG hReg, RKEY key, const char *name, uint16 type, void *buffer, uint32 size ) { REGERR err; @@ -3407,7 +3407,7 @@ * name - name of entry * --------------------------------------------------------------------- */ -VR_INTERFACE(REGERR) NR_RegDeleteEntry( HREG hReg, RKEY key, char *name ) +VR_INTERFACE(REGERR) NR_RegDeleteEntry( HREG hReg, RKEY key, const char *name ) { REGERR err; REGFILE* reg; Index: xpinstall/src/nsInstallResources.cpp =================================================================== RCS file: /cvsroot/mozilla/xpinstall/src/nsInstallResources.cpp,v retrieving revision 1.12 diff -u -r1.12 nsInstallResources.cpp --- xpinstall/src/nsInstallResources.cpp 17 Apr 2004 14:37:28 -0000 1.12 +++ xpinstall/src/nsInstallResources.cpp 14 Sep 2006 06:56:11 -0000 @@ -90,11 +90,11 @@ { NS_XPI_EOT, "" } }; -char* +const char* nsInstallResources::GetDefaultVal(const char* aResName) { - char *currResName = XPIResTable[0].resName; - char *currResVal = nsnull; + const char *currResName = XPIResTable[0].resName; + const char *currResVal = nsnull; PRInt32 idx, len = 0; for (idx = 0; 0 != strcmp(currResName, NS_XPI_EOT); idx++) Index: xpinstall/src/nsInstallResources.h =================================================================== RCS file: /cvsroot/mozilla/xpinstall/src/nsInstallResources.h,v retrieving revision 1.7 diff -u -r1.7 nsInstallResources.h --- xpinstall/src/nsInstallResources.h 17 Apr 2004 14:37:28 -0000 1.7 +++ xpinstall/src/nsInstallResources.h 14 Sep 2006 06:56:11 -0000 @@ -47,8 +47,8 @@ typedef struct _nsXPIResourceTableItem { - char *resName; - char *defaultString; + const char *resName; + const char *defaultString; } nsXPIResourceTableItem; @@ -56,7 +56,7 @@ { public: - static char* GetDefaultVal(const char* aResName); + static const char* GetDefaultVal(const char* aResName); };