Closed Bug 330 Opened 22 years ago Closed 21 years ago

Superfluous warnings and cleanup

Categories

(MozillaClassic Graveyard :: Preferences, defect, P3)

1998-04-08
defect

Tracking

(Not tracked)

VERIFIED WONTFIX

People

(Reporter: aoki, Assigned: aoki)

References

Details

Created by   (null) on Wednesday, May 6, 1998 10:34:23 PM PDT
Additional Details :
Reported by Brian Grunkemeyer (bg2k@andrew.cmu.edu)

Added a default case to a switch to handle some unhandled
enum values, but I don't know if that ever comes up, and I
don't know if it's a bad thing.  So right now it just prints
out that it fell through the switch at that file & line
number.  Maybe there should be an assertion saying someone
called the function with the wrong parameters, if these are
wrong.  Have someone who understands that file check this
and do something intelligent.

   Got rid of some unused variables as well.

   Apply this patch in modules/libpref/src/.

     -------------------------------------------------------
-----------------
   Index: prefapi.c
   =======
   =========================================================
===
   RCS file: /cvsroot/mozilla/modules/libpref/src/
prefapi.c,v
   retrieving revision 3.1
   diff -u -r3.1 prefapi.c
   --- prefapi.c   1998/03/28 03:35:10     3.1
   +++ prefapi.c   1998/05/03 00:27:26
   @@ -1454,6 +1454,10 @@
                   case PREF_BOOL:
                           changed = oldValue.boolVal !=
newValue.boolVal;
                           break;
   +               default:
   +                       /* This doesn't handle
PREF_LOCKED, PREF_USERSET,
   +                          PREF_CONFIG, nor PREF_LILOCAL.
Is this bad? */
   +                       fprintf(stderr, "Fell through
case in %s at line %d.  Is this bad?\n",
   __FILE__, __LINE__);
           }
           return changed;
    }
   @@ -1655,9 +1659,8 @@
    JSBool PR_CALLBACK pref_NativeGetPref
           (JSContext *cx, JSObject *obj, unsigned int argc,
jsval *argv, jsval *rval)
    {
   -       void* value = NULL;
           PrefNode* pref;
   -       XP_Bool prefExists = TRUE;
   +       /* Unused:  XP_Bool prefExists = TRUE; */

        if (argc >= 1 && JSVAL_IS_STRING(argv[0]))
        {
   @@ -2042,7 +2045,6 @@
    {
           char *last;

   -       int i, j, k, n;
           const char *s, *t;

           last = PR_sprintf_append(0, "An error occurred
reading the startup
   configuration file.  "
Status: NEW → ASSIGNED
Fix will be included as part of the 4.5 profile manager merge to tip.
Setting all current Open/Normal to M4.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → WONTFIX
old codebase
*** Bug 331 has been marked as a duplicate of this bug. ***
*** Bug 332 has been marked as a duplicate of this bug. ***
vrfy wontfix
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.