From 48665497a511f633976fdcb05cd0fbc18fc19aae Mon Sep 17 00:00:00 2001 From: "bnesse%netscape.com" Date: Thu, 2 May 2002 20:34:17 +0000 Subject: [PATCH] Fix for bug 141552. Remove unused static functions from prefs. r=blythe, sr=jsg. git-svn-id: svn://10.0.0.236/trunk@120564 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/libpref/src/prefapi.cpp | 62 ------------------------- 1 file changed, 62 deletions(-) diff --git a/mozilla/modules/libpref/src/prefapi.cpp b/mozilla/modules/libpref/src/prefapi.cpp index b621a5f9257..548cee7d8f6 100644 --- a/mozilla/modules/libpref/src/prefapi.cpp +++ b/mozilla/modules/libpref/src/prefapi.cpp @@ -675,7 +675,6 @@ PrefResult PREF_GetCharPref(const char *pref_name, char * return_buffer, int * l return PREF_NOT_INITIALIZED; pref = pref_HashTableLookup(pref_name); - // NS_ASSERTION(pref, pref_name); if (pref) { @@ -1100,67 +1099,6 @@ PREF_PrefIsLocked(const char *pref_name) return result; } -/* - * Creates an iterator over the children of a node. - */ -typedef struct -{ - char* childList; - char* parent; - int bufsize; -} PrefChildIter; - -/* if entry begins with the given string, i.e. if string is - "a" - and entry is - "a.b.c" or "a.b" - then add "a.b" to the list. */ -PR_STATIC_CALLBACK(PLDHashOperator) -pref_addChild(PLDHashTable *table, PLDHashEntryHdr* heh,PRUint32 number,void *arg) -{ - PrefHashEntry* he = NS_STATIC_CAST(PrefHashEntry*,heh); - PrefChildIter* pcs = (PrefChildIter*) arg; - if ( PL_strncmp(he->key, pcs->parent, PL_strlen(pcs->parent)) == 0 ) - { - char buf[512]; - char* nextdelim; - PRUint32 parentlen = PL_strlen(pcs->parent); - char* substring; - - strncpy(buf, he->key, PR_MIN(512, PL_strlen(he->key) + 2)); - nextdelim = buf + parentlen; - if (parentlen < PL_strlen(buf)) - { - /* Find the next delimiter if any and truncate the string there */ - nextdelim = strstr(nextdelim, "."); - if (nextdelim) - { - *nextdelim = ';'; - *(nextdelim + 1) = '\0'; - } else { - /* otherwise, ensure string always ends with a ';' character so strtok will be happy. */ - strcat(buf, ";"); - } - } - - substring = strstr(pcs->childList, buf); - - if (!substring) - { - int newsize = PL_strlen(pcs->childList) + PL_strlen(buf) + 2; - if (newsize > pcs->bufsize) - { - pcs->bufsize *= 3; - pcs->childList = (char*) realloc(pcs->childList, sizeof(char) * pcs->bufsize); - if (!pcs->childList) - return PL_DHASH_STOP; - } - PL_strcat(pcs->childList, buf); - } - } - return PL_DHASH_NEXT; -} - /* Adds a node to the beginning of the callback list. */ void PREF_RegisterCallback(const char *pref_node,