From ac2144507dfe4b6e61ad063997046aa0dbfe6167 Mon Sep 17 00:00:00 2001 From: "mcmullen%netscape.com" Date: Fri, 2 Apr 1999 20:39:17 +0000 Subject: [PATCH] I changed prefapi.h to use prtypes instead of the obsolete XP_ things. git-svn-id: svn://10.0.0.236/trunk@26079 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/libpref/public/prefapi.h | 63 +++++++++++------------- mozilla/modules/libpref/src/prefapi.c | 56 ++++++++++----------- mozilla/modules/libpref/src/prefapi.cpp | 56 ++++++++++----------- 3 files changed, 86 insertions(+), 89 deletions(-) diff --git a/mozilla/modules/libpref/public/prefapi.h b/mozilla/modules/libpref/public/prefapi.h index 88c12fec7d6..3c22f0f46e2 100644 --- a/mozilla/modules/libpref/public/prefapi.h +++ b/mozilla/modules/libpref/public/prefapi.h @@ -94,10 +94,10 @@ PrefResult pref_InitInitialObjects(JSContext *js_context,JSObject *js_object); */ PR_EXTERN(PrefResult) -PREF_ReadUserJSFile(char *filename); +PREF_ReadUserJSFile(const char *filename); PR_EXTERN(PrefResult) -PREF_ReadLIJSFile(char *filename); +PREF_ReadLIJSFile(const char *filename); #if defined (XP_PC) || defined (XP_MAC) /* PREF_Init actually returns a profile object */ @@ -109,7 +109,7 @@ PREF_GetCurrentProfile(void); #endif PR_EXTERN(PRBool) -PREF_Init(char *filename); +PREF_Init(const char *filename); PR_EXTERN(PrefResult) PREF_LockPref(const char *key); @@ -215,12 +215,12 @@ typedef enum { PREF_INVALID = 0, // */ PR_EXTERN(PrefResult) PREF_SetCharPref(const char *pref,const char* value); -PR_EXTERN(PrefResult) PREF_SetIntPref(const char *pref,int32 value); +PR_EXTERN(PrefResult) PREF_SetIntPref(const char *pref,PRInt32 value); PR_EXTERN(PrefResult) PREF_SetBoolPref(const char *pref,PRBool value); PR_EXTERN(PrefResult) PREF_SetBinaryPref(const char *pref,void * value, long size); -PR_EXTERN(PrefResult) PREF_SetColorPref(const char *pref_name, uint8 red, uint8 green, uint8 blue); -PR_EXTERN(PrefResult) PREF_SetColorPrefDWord(const char *pref_name, uint32 colorref); -PR_EXTERN(PrefResult) PREF_SetRectPref(const char *pref_name, int16 left, int16 top, int16 right, int16 bottom); +PR_EXTERN(PrefResult) PREF_SetColorPref(const char *pref_name, PRUint8 red, PRUint8 green, PRUint8 blue); +PR_EXTERN(PrefResult) PREF_SetColorPrefDWord(const char *pref_name, PRUint32 colorref); +PR_EXTERN(PrefResult) PREF_SetRectPref(const char *pref_name, PRInt16 left, PRInt16 top, PRInt16 right, PRInt16 bottom); /* // @@ -232,11 +232,11 @@ PR_EXTERN(PrefResult) PREF_SetRectPref(const char *pref_name, int16 left, int16 // */ PR_EXTERN(PrefResult) PREF_SetDefaultCharPref(const char *pref,const char* value); -PR_EXTERN(PrefResult) PREF_SetDefaultIntPref(const char *pref,int32 value); +PR_EXTERN(PrefResult) PREF_SetDefaultIntPref(const char *pref,PRInt32 value); PR_EXTERN(PrefResult) PREF_SetDefaultBoolPref(const char *pref,PRBool value); PR_EXTERN(PrefResult) PREF_SetDefaultBinaryPref(const char *pref,void * value, long size); -PR_EXTERN(PrefResult) PREF_SetDefaultColorPref(const char *pref_name, uint8 red, uint8 green, uint8 blue); -PR_EXTERN(PrefResult) PREF_SetDefaultRectPref(const char *pref_name, int16 left, int16 top, int16 right, int16 bottom); +PR_EXTERN(PrefResult) PREF_SetDefaultColorPref(const char *pref_name, PRUint8 red, PRUint8 green, PRUint8 blue); +PR_EXTERN(PrefResult) PREF_SetDefaultRectPref(const char *pref_name, PRInt16 left, PRInt16 top, PRInt16 right, PRInt16 bottom); /* // @@ -257,12 +257,12 @@ PR_EXTERN(PrefResult) PREF_SetDefaultRectPref(const char *pref_name, int16 left, // */ PR_EXTERN(PrefResult) PREF_GetCharPref(const char *pref, char * return_buf, int * buf_length); -PR_EXTERN(PrefResult) PREF_GetIntPref(const char *pref, int32 * return_int); -PR_EXTERN(PrefResult) PREF_GetBoolPref(const char *pref, XP_Bool * return_val); +PR_EXTERN(PrefResult) PREF_GetIntPref(const char *pref, PRInt32 * return_int); +PR_EXTERN(PrefResult) PREF_GetBoolPref(const char *pref, PRBool * return_val); PR_EXTERN(PrefResult) PREF_GetBinaryPref(const char *pref, void * return_val, int * buf_length); -PR_EXTERN(PrefResult) PREF_GetColorPref(const char *pref_name, uint8 *red, uint8 *green, uint8 *blue); -PR_EXTERN(PrefResult) PREF_GetColorPrefDWord(const char *pref_name, uint32 *colorref); -PR_EXTERN(PrefResult) PREF_GetRectPref(const char *pref_name, int16 *left, int16 *top, int16 *right, int16 *bottom); +PR_EXTERN(PrefResult) PREF_GetColorPref(const char *pref_name, PRUint8 *red, PRUint8 *green, PRUint8 *blue); +PR_EXTERN(PrefResult) PREF_GetColorPrefDWord(const char *pref_name, PRUint32 *colorref); +PR_EXTERN(PrefResult) PREF_GetRectPref(const char *pref_name, PRInt16 *left, PRInt16 *top, PRInt16 *right, PRInt16 *bottom); /* // @@ -298,12 +298,12 @@ PR_EXTERN(PrefResult) PREF_SetPathPref(const char *pref_name, const char *path, // */ PR_EXTERN(PrefResult) PREF_GetDefaultCharPref(const char *pref, char * return_buf, int * buf_length); -PR_EXTERN(PrefResult) PREF_GetDefaultIntPref(const char *pref, int32 * return_int); -PR_EXTERN(PrefResult) PREF_GetDefaultBoolPref(const char *pref, XP_Bool * return_val); +PR_EXTERN(PrefResult) PREF_GetDefaultIntPref(const char *pref, PRInt32 * return_int); +PR_EXTERN(PrefResult) PREF_GetDefaultBoolPref(const char *pref, PRBool * return_val); PR_EXTERN(PrefResult) PREF_GetDefaultBinaryPref(const char *pref, void * return_val, int * buf_length); -PR_EXTERN(PrefResult) PREF_GetDefaultColorPref(const char *pref_name, uint8 *red, uint8 *green, uint8 *blue); -PR_EXTERN(PrefResult) PREF_GetDefaultColorPrefDWord(const char *pref_name, uint32 *colorref); -PR_EXTERN(PrefResult) PREF_GetDefaultRectPref(const char *pref_name, int16 *left, int16 *top, int16 *right, int16 *bottom); +PR_EXTERN(PrefResult) PREF_GetDefaultColorPref(const char *pref_name, PRUint8 *red, PRUint8 *green, PRUint8 *blue); +PR_EXTERN(PrefResult) PREF_GetDefaultColorPrefDWord(const char *pref_name, PRUint32 *colorref); +PR_EXTERN(PrefResult) PREF_GetDefaultRectPref(const char *pref_name, PRInt16 *left, PRInt16 *top, PRInt16 *right, PRInt16 *bottom); /* // @@ -322,8 +322,8 @@ PR_EXTERN(PrefResult) PREF_GetDefaultRectPref(const char *pref_name, int16 *left PR_EXTERN(PrefResult) PREF_CopyConfigString(const char *obj_name, char **return_buffer); PR_EXTERN(PrefResult) PREF_CopyIndexConfigString(const char *obj_name, int index, const char *field, char **return_buffer); -PR_EXTERN(PrefResult) PREF_GetConfigInt(const char *obj_name, int32 *return_int); -PR_EXTERN(PrefResult) PREF_GetConfigBool(const char *obj_name, XP_Bool *return_bool); +PR_EXTERN(PrefResult) PREF_GetConfigInt(const char *obj_name, PRInt32 *return_int); +PR_EXTERN(PrefResult) PREF_GetConfigBool(const char *obj_name, PRBool *return_bool); /* OLD:: */PR_EXTERN(PrefResult) PREF_GetConfigString(const char *obj_name, char * return_buffer, int size, int index, const char *field); @@ -392,17 +392,14 @@ PR_EXTERN(PrefResult) PREF_ClearUserPref(const char *pref_name); PR_EXTERN(PrefResult) PREF_CreateChildList(const char* parent_node, char **child_list); PR_EXTERN(char*) PREF_NextChild(char *child_list, int *index); -/* - * Copies parts of the hierarchy from one root to another. - For example, PREF_CopyPrefsTree("mail","newmail") copies all - the "mail." prefs to "newmail." prefs. It does not delete the - source tree; you should do that yourself. - - Either srcRoot or destRoot can be empty strings, to denote - the root of the entire tree, but cannot be NULL. - * - * -*/ +/* The following function parts of the hierarchy from one root to another. + * For example, PREF_CopyPrefsTree("mail","newmail") copies all + * the "mail." prefs to "newmail." prefs. It does not delete the + * source tree; you should do that yourself. + * + * Either srcRoot or destRoot can be empty strings, to denote + * the root of the entire tree, but cannot be NULL. + */ PR_EXTERN(PrefResult) PREF_CopyPrefsTree(const char *srcRoot, const char *destRoot); /* diff --git a/mozilla/modules/libpref/src/prefapi.c b/mozilla/modules/libpref/src/prefapi.c index f55f9bde433..b6fed5ad809 100644 --- a/mozilla/modules/libpref/src/prefapi.c +++ b/mozilla/modules/libpref/src/prefapi.c @@ -94,7 +94,7 @@ static char * m_SavedLine = NULL; typedef union { char* stringVal; - int32 intVal; + PRInt32 intVal; PRBool boolVal; } PrefValue; @@ -106,7 +106,7 @@ typedef struct } PrefNode; static JSBool pref_HashJSPref(unsigned int argc, jsval *argv, PrefAction action); -static XP_Bool pref_ValueChanged(PrefValue oldValue, PrefValue newValue, PrefType type); +static PRBool pref_ValueChanged(PrefValue oldValue, PrefValue newValue, PrefType type); /* Hash table allocation */ PR_IMPLEMENT(void *) @@ -140,7 +140,7 @@ pref_FreeEntry(void *pool, PRHashEntry *he, uint flag) } if (flag == HT_FREE_ENTRY) { - PR_FREEIF(he->key); + PR_FREEIF((void*)he->key); PR_Free(he); } } @@ -174,8 +174,8 @@ PRBool pref_VerifyLockFile(char* buf, long buflen); PrefResult pref_GetCharPref(const char *pref_name, char * return_buffer, int * length, PRBool get_default); PrefResult pref_CopyCharPref(const char *pref_name, char ** return_buffer, PRBool get_default); -PrefResult pref_GetIntPref(const char *pref_name,int32 * return_int, PRBool get_default); -PrefResult pref_GetBoolPref(const char *pref_name, XP_Bool * return_value, PRBool get_default); +PrefResult pref_GetIntPref(const char *pref_name,PRInt32 * return_int, PRBool get_default); +PrefResult pref_GetBoolPref(const char *pref_name, PRBool * return_value, PRBool get_default); JSBool PR_CALLBACK pref_BranchCallback(JSContext *cx, JSScript *script); void pref_ErrorReporter(JSContext *cx, const char *message,JSErrorReport *report); @@ -340,7 +340,7 @@ PRBool pref_VerifyLockFile(char* buf, long buflen) } PR_IMPLEMENT(PrefResult) -PREF_ReadLIJSFile(char *filename) +PREF_ReadLIJSFile(const char *filename) { PrefResult ok; @@ -352,7 +352,7 @@ PREF_ReadLIJSFile(char *filename) } PR_IMPLEMENT(PrefResult) -PREF_ReadUserJSFile(char *filename) +PREF_ReadUserJSFile(const char *filename) { PrefResult ok = pref_OpenFile(filename, PR_FALSE, PR_FALSE, PR_TRUE, PR_FALSE); @@ -360,7 +360,7 @@ PREF_ReadUserJSFile(char *filename) } PR_IMPLEMENT(PRBool) -PREF_Init(char *filename) +PREF_Init(const char *filename) { PRBool ok = PR_TRUE; @@ -378,7 +378,7 @@ PREF_Init(char *filename) } if (!m_mochaTaskState) - m_mochaTaskState = JS_Init((uint32) 0xffffffffL); + m_mochaTaskState = JS_Init((PRUint32) 0xffffffffL); if (!m_mochaContext) { m_mochaContext = JS_NewContext(m_mochaTaskState, 8192); /* ???? What size? */ @@ -680,7 +680,7 @@ PREF_SetCharPref(const char *pref_name, const char *value) } PR_IMPLEMENT(PrefResult) -PREF_SetIntPref(const char *pref_name, int32 value) +PREF_SetIntPref(const char *pref_name, PRInt32 value) { PrefValue pref; pref.intVal = value; @@ -727,7 +727,7 @@ PREF_SetColorPref(const char *pref_name, uint8 red, uint8 green, uint8 blue) #define MYGetRValue(rgb) ((uint8) (rgb)) PR_IMPLEMENT(PrefResult) -PREF_SetColorPrefDWord(const char *pref_name, uint32 colorref) +PREF_SetColorPrefDWord(const char *pref_name, PRUint32 colorref) { int red,green,blue; char colstr[63]; @@ -767,7 +767,7 @@ PREF_SetDefaultCharPref(const char *pref_name,const char *value) PR_IMPLEMENT(PrefResult) -PREF_SetDefaultIntPref(const char *pref_name,int32 value) +PREF_SetDefaultIntPref(const char *pref_name,PRInt32 value) { PrefValue pref; pref.intVal = value; @@ -1205,7 +1205,7 @@ PrefResult pref_CopyCharPref(const char *pref_name, char ** return_buffer, PRBoo return result; } -PrefResult pref_GetIntPref(const char *pref_name,int32 * return_int, PRBool get_default) +PrefResult pref_GetIntPref(const char *pref_name,PRInt32 * return_int, PRBool get_default) { PrefResult result = PREF_ERROR; PrefNode* pref; @@ -1224,7 +1224,7 @@ PrefResult pref_GetIntPref(const char *pref_name,int32 * return_int, PRBool get_ return result; } -PrefResult pref_GetBoolPref(const char *pref_name, XP_Bool * return_value, PRBool get_default) +PrefResult pref_GetBoolPref(const char *pref_name, PRBool * return_value, PRBool get_default) { PrefResult result = PREF_ERROR; PrefNode* pref; @@ -1257,13 +1257,13 @@ PREF_CopyCharPref(const char *pref_name, char ** return_buffer) } PR_IMPLEMENT(PrefResult) -PREF_GetIntPref(const char *pref_name,int32 * return_int) +PREF_GetIntPref(const char *pref_name,PRInt32 * return_int) { return pref_GetIntPref(pref_name, return_int, PR_FALSE); } PR_IMPLEMENT(PrefResult) -PREF_GetBoolPref(const char *pref_name, XP_Bool * return_value) +PREF_GetBoolPref(const char *pref_name, PRBool * return_value) { return pref_GetBoolPref(pref_name, return_value, PR_FALSE); } @@ -1287,10 +1287,10 @@ PREF_GetColorPref(const char *pref_name, uint8 *red, uint8 *green, uint8 *blue) return result; } -#define MYRGB(r, g ,b) ((uint32) (((uint8) (r) | ((uint16) (g) << 8)) | (((uint32) (uint8) (b)) << 16))) +#define MYRGB(r, g ,b) ((PRUint32) (((uint8) (r) | ((uint16) (g) << 8)) | (((PRUint32) (uint8) (b)) << 16))) PR_IMPLEMENT(PrefResult) -PREF_GetColorPrefDWord(const char *pref_name, uint32 *colorref) +PREF_GetColorPrefDWord(const char *pref_name, PRUint32 *colorref) { uint8 red, green, blue; PrefResult result; @@ -1417,13 +1417,13 @@ PREF_CopyDefaultCharPref(const char *pref_name, char ** return_buffer) } PR_IMPLEMENT(PrefResult) -PREF_GetDefaultIntPref(const char *pref_name, int32 * return_int) +PREF_GetDefaultIntPref(const char *pref_name, PRInt32 * return_int) { return pref_GetIntPref(pref_name, return_int, PR_TRUE); } PR_IMPLEMENT(PrefResult) -PREF_GetDefaultBoolPref(const char *pref_name, XP_Bool * return_value) +PREF_GetDefaultBoolPref(const char *pref_name, PRBool * return_value) { return pref_GetBoolPref(pref_name, return_value, PR_TRUE); } @@ -1455,7 +1455,7 @@ PREF_GetDefaultColorPref(const char *pref_name, uint8 *red, uint8 *green, uint8 } PR_IMPLEMENT(PrefResult) -PREF_GetDefaultColorPrefDWord(const char *pref_name, uint32 * colorref) +PREF_GetDefaultColorPrefDWord(const char *pref_name, PRUint32 * colorref) { uint8 red, green, blue; PrefResult result; @@ -1602,7 +1602,7 @@ PREF_CopyIndexConfigString(const char *obj_name, } PR_IMPLEMENT(PrefResult) -PREF_GetConfigInt(const char *obj_name, int32 *return_int) +PREF_GetConfigInt(const char *obj_name, PRInt32 *return_int) { PrefResult success = PREF_ERROR; @@ -1617,7 +1617,7 @@ PREF_GetConfigInt(const char *obj_name, int32 *return_int) } PR_IMPLEMENT(PrefResult) -PREF_GetConfigBool(const char *obj_name, XP_Bool *return_bool) +PREF_GetConfigBool(const char *obj_name, PRBool *return_bool) { PrefResult success = PREF_ERROR; @@ -1680,7 +1680,7 @@ PREF_LockPref(const char *key) /* * Hash table functions */ -static XP_Bool pref_ValueChanged(PrefValue oldValue, PrefValue newValue, PrefType type) +static PRBool pref_ValueChanged(PrefValue oldValue, PrefValue newValue, PrefType type) { PRBool changed = PR_TRUE; if (type & PREF_STRING) { @@ -1727,7 +1727,7 @@ PrefResult pref_HashPref(const char *key, PrefValue value, PrefType type, PrefAc /* ugly hack -- define it to a default that no pref will ever default to this should really get fixed right by some out of band data */ if (pref->flags & PREF_INT) - pref->defaultPref.intVal = (int32) -5632; + pref->defaultPref.intVal = (PRInt32) -5632; PR_HashTableAdd(m_HashTable, PL_strdup(key), pref); } else if ((pref->flags & PREF_VALUETYPE_MASK) != (type & PREF_VALUETYPE_MASK)) { @@ -2101,7 +2101,7 @@ PrefResult pref_copyTree(const char *srcPrefix, const char *destPrefix, const ch case PREF_INT: { - int32 prefValInt; + PRInt32 prefValInt; result = PREF_GetIntPref(child, &prefValInt); if (result == PREF_NOERROR) @@ -2111,7 +2111,7 @@ PrefResult pref_copyTree(const char *srcPrefix, const char *destPrefix, const ch case PREF_BOOL: { - XP_Bool prefBool; + PRBool prefBool; result = PREF_GetBoolPref(child, &prefBool); if (result == PREF_NOERROR) @@ -2364,7 +2364,7 @@ PREF_AboutConfig() JSBool PR_CALLBACK pref_BranchCallback(JSContext *cx, JSScript *script) { - static uint32 count = 0; + static PRUint32 count = 0; /* * If we've been running for a long time, then try a GC to diff --git a/mozilla/modules/libpref/src/prefapi.cpp b/mozilla/modules/libpref/src/prefapi.cpp index f55f9bde433..b6fed5ad809 100644 --- a/mozilla/modules/libpref/src/prefapi.cpp +++ b/mozilla/modules/libpref/src/prefapi.cpp @@ -94,7 +94,7 @@ static char * m_SavedLine = NULL; typedef union { char* stringVal; - int32 intVal; + PRInt32 intVal; PRBool boolVal; } PrefValue; @@ -106,7 +106,7 @@ typedef struct } PrefNode; static JSBool pref_HashJSPref(unsigned int argc, jsval *argv, PrefAction action); -static XP_Bool pref_ValueChanged(PrefValue oldValue, PrefValue newValue, PrefType type); +static PRBool pref_ValueChanged(PrefValue oldValue, PrefValue newValue, PrefType type); /* Hash table allocation */ PR_IMPLEMENT(void *) @@ -140,7 +140,7 @@ pref_FreeEntry(void *pool, PRHashEntry *he, uint flag) } if (flag == HT_FREE_ENTRY) { - PR_FREEIF(he->key); + PR_FREEIF((void*)he->key); PR_Free(he); } } @@ -174,8 +174,8 @@ PRBool pref_VerifyLockFile(char* buf, long buflen); PrefResult pref_GetCharPref(const char *pref_name, char * return_buffer, int * length, PRBool get_default); PrefResult pref_CopyCharPref(const char *pref_name, char ** return_buffer, PRBool get_default); -PrefResult pref_GetIntPref(const char *pref_name,int32 * return_int, PRBool get_default); -PrefResult pref_GetBoolPref(const char *pref_name, XP_Bool * return_value, PRBool get_default); +PrefResult pref_GetIntPref(const char *pref_name,PRInt32 * return_int, PRBool get_default); +PrefResult pref_GetBoolPref(const char *pref_name, PRBool * return_value, PRBool get_default); JSBool PR_CALLBACK pref_BranchCallback(JSContext *cx, JSScript *script); void pref_ErrorReporter(JSContext *cx, const char *message,JSErrorReport *report); @@ -340,7 +340,7 @@ PRBool pref_VerifyLockFile(char* buf, long buflen) } PR_IMPLEMENT(PrefResult) -PREF_ReadLIJSFile(char *filename) +PREF_ReadLIJSFile(const char *filename) { PrefResult ok; @@ -352,7 +352,7 @@ PREF_ReadLIJSFile(char *filename) } PR_IMPLEMENT(PrefResult) -PREF_ReadUserJSFile(char *filename) +PREF_ReadUserJSFile(const char *filename) { PrefResult ok = pref_OpenFile(filename, PR_FALSE, PR_FALSE, PR_TRUE, PR_FALSE); @@ -360,7 +360,7 @@ PREF_ReadUserJSFile(char *filename) } PR_IMPLEMENT(PRBool) -PREF_Init(char *filename) +PREF_Init(const char *filename) { PRBool ok = PR_TRUE; @@ -378,7 +378,7 @@ PREF_Init(char *filename) } if (!m_mochaTaskState) - m_mochaTaskState = JS_Init((uint32) 0xffffffffL); + m_mochaTaskState = JS_Init((PRUint32) 0xffffffffL); if (!m_mochaContext) { m_mochaContext = JS_NewContext(m_mochaTaskState, 8192); /* ???? What size? */ @@ -680,7 +680,7 @@ PREF_SetCharPref(const char *pref_name, const char *value) } PR_IMPLEMENT(PrefResult) -PREF_SetIntPref(const char *pref_name, int32 value) +PREF_SetIntPref(const char *pref_name, PRInt32 value) { PrefValue pref; pref.intVal = value; @@ -727,7 +727,7 @@ PREF_SetColorPref(const char *pref_name, uint8 red, uint8 green, uint8 blue) #define MYGetRValue(rgb) ((uint8) (rgb)) PR_IMPLEMENT(PrefResult) -PREF_SetColorPrefDWord(const char *pref_name, uint32 colorref) +PREF_SetColorPrefDWord(const char *pref_name, PRUint32 colorref) { int red,green,blue; char colstr[63]; @@ -767,7 +767,7 @@ PREF_SetDefaultCharPref(const char *pref_name,const char *value) PR_IMPLEMENT(PrefResult) -PREF_SetDefaultIntPref(const char *pref_name,int32 value) +PREF_SetDefaultIntPref(const char *pref_name,PRInt32 value) { PrefValue pref; pref.intVal = value; @@ -1205,7 +1205,7 @@ PrefResult pref_CopyCharPref(const char *pref_name, char ** return_buffer, PRBoo return result; } -PrefResult pref_GetIntPref(const char *pref_name,int32 * return_int, PRBool get_default) +PrefResult pref_GetIntPref(const char *pref_name,PRInt32 * return_int, PRBool get_default) { PrefResult result = PREF_ERROR; PrefNode* pref; @@ -1224,7 +1224,7 @@ PrefResult pref_GetIntPref(const char *pref_name,int32 * return_int, PRBool get_ return result; } -PrefResult pref_GetBoolPref(const char *pref_name, XP_Bool * return_value, PRBool get_default) +PrefResult pref_GetBoolPref(const char *pref_name, PRBool * return_value, PRBool get_default) { PrefResult result = PREF_ERROR; PrefNode* pref; @@ -1257,13 +1257,13 @@ PREF_CopyCharPref(const char *pref_name, char ** return_buffer) } PR_IMPLEMENT(PrefResult) -PREF_GetIntPref(const char *pref_name,int32 * return_int) +PREF_GetIntPref(const char *pref_name,PRInt32 * return_int) { return pref_GetIntPref(pref_name, return_int, PR_FALSE); } PR_IMPLEMENT(PrefResult) -PREF_GetBoolPref(const char *pref_name, XP_Bool * return_value) +PREF_GetBoolPref(const char *pref_name, PRBool * return_value) { return pref_GetBoolPref(pref_name, return_value, PR_FALSE); } @@ -1287,10 +1287,10 @@ PREF_GetColorPref(const char *pref_name, uint8 *red, uint8 *green, uint8 *blue) return result; } -#define MYRGB(r, g ,b) ((uint32) (((uint8) (r) | ((uint16) (g) << 8)) | (((uint32) (uint8) (b)) << 16))) +#define MYRGB(r, g ,b) ((PRUint32) (((uint8) (r) | ((uint16) (g) << 8)) | (((PRUint32) (uint8) (b)) << 16))) PR_IMPLEMENT(PrefResult) -PREF_GetColorPrefDWord(const char *pref_name, uint32 *colorref) +PREF_GetColorPrefDWord(const char *pref_name, PRUint32 *colorref) { uint8 red, green, blue; PrefResult result; @@ -1417,13 +1417,13 @@ PREF_CopyDefaultCharPref(const char *pref_name, char ** return_buffer) } PR_IMPLEMENT(PrefResult) -PREF_GetDefaultIntPref(const char *pref_name, int32 * return_int) +PREF_GetDefaultIntPref(const char *pref_name, PRInt32 * return_int) { return pref_GetIntPref(pref_name, return_int, PR_TRUE); } PR_IMPLEMENT(PrefResult) -PREF_GetDefaultBoolPref(const char *pref_name, XP_Bool * return_value) +PREF_GetDefaultBoolPref(const char *pref_name, PRBool * return_value) { return pref_GetBoolPref(pref_name, return_value, PR_TRUE); } @@ -1455,7 +1455,7 @@ PREF_GetDefaultColorPref(const char *pref_name, uint8 *red, uint8 *green, uint8 } PR_IMPLEMENT(PrefResult) -PREF_GetDefaultColorPrefDWord(const char *pref_name, uint32 * colorref) +PREF_GetDefaultColorPrefDWord(const char *pref_name, PRUint32 * colorref) { uint8 red, green, blue; PrefResult result; @@ -1602,7 +1602,7 @@ PREF_CopyIndexConfigString(const char *obj_name, } PR_IMPLEMENT(PrefResult) -PREF_GetConfigInt(const char *obj_name, int32 *return_int) +PREF_GetConfigInt(const char *obj_name, PRInt32 *return_int) { PrefResult success = PREF_ERROR; @@ -1617,7 +1617,7 @@ PREF_GetConfigInt(const char *obj_name, int32 *return_int) } PR_IMPLEMENT(PrefResult) -PREF_GetConfigBool(const char *obj_name, XP_Bool *return_bool) +PREF_GetConfigBool(const char *obj_name, PRBool *return_bool) { PrefResult success = PREF_ERROR; @@ -1680,7 +1680,7 @@ PREF_LockPref(const char *key) /* * Hash table functions */ -static XP_Bool pref_ValueChanged(PrefValue oldValue, PrefValue newValue, PrefType type) +static PRBool pref_ValueChanged(PrefValue oldValue, PrefValue newValue, PrefType type) { PRBool changed = PR_TRUE; if (type & PREF_STRING) { @@ -1727,7 +1727,7 @@ PrefResult pref_HashPref(const char *key, PrefValue value, PrefType type, PrefAc /* ugly hack -- define it to a default that no pref will ever default to this should really get fixed right by some out of band data */ if (pref->flags & PREF_INT) - pref->defaultPref.intVal = (int32) -5632; + pref->defaultPref.intVal = (PRInt32) -5632; PR_HashTableAdd(m_HashTable, PL_strdup(key), pref); } else if ((pref->flags & PREF_VALUETYPE_MASK) != (type & PREF_VALUETYPE_MASK)) { @@ -2101,7 +2101,7 @@ PrefResult pref_copyTree(const char *srcPrefix, const char *destPrefix, const ch case PREF_INT: { - int32 prefValInt; + PRInt32 prefValInt; result = PREF_GetIntPref(child, &prefValInt); if (result == PREF_NOERROR) @@ -2111,7 +2111,7 @@ PrefResult pref_copyTree(const char *srcPrefix, const char *destPrefix, const ch case PREF_BOOL: { - XP_Bool prefBool; + PRBool prefBool; result = PREF_GetBoolPref(child, &prefBool); if (result == PREF_NOERROR) @@ -2364,7 +2364,7 @@ PREF_AboutConfig() JSBool PR_CALLBACK pref_BranchCallback(JSContext *cx, JSScript *script) { - static uint32 count = 0; + static PRUint32 count = 0; /* * If we've been running for a long time, then try a GC to