cvsuser     05/04/09 01:21:28

  Modified:    src      dod.c gc_ims.c global_setup.c headers.c mmd.c
                        mmd_fallback.c pmc.c pmc_freeze.c string.c sub.c
                        thread.c utils.c
  Log:
  [perl #34891] [PATCH] remove 'unreferenced local variable' warnings
  
  i'm in the process of removing warnings from parrot, and i thought i'd split
  the patches up into manageable chunks. this patch removes 'unreferenced
  local variable' warnings from all src/*.c files.
  
  Courtesy of Jerry Gay <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  1.147     +3 -2      parrot/src/dod.c
  
  Index: dod.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/dod.c,v
  retrieving revision 1.146
  retrieving revision 1.147
  diff -u -r1.146 -r1.147
  --- dod.c     14 Mar 2005 14:45:40 -0000      1.146
  +++ dod.c     9 Apr 2005 08:21:27 -0000       1.147
  @@ -1130,7 +1130,9 @@
   Parrot_dod_ms_run_init(Interp *interpreter)
   {
       struct Arenas *arena_base = interpreter->arena_base;
  +#if ARENA_DOD_FLAGS
       int j;
  +#endif
   
       arena_base->dod_trace_ptr = NULL;
       arena_base->dod_mark_start = NULL;
  @@ -1171,7 +1173,6 @@
   Parrot_dod_ms_run(Interp *interpreter, int flags)
   {
       struct Arenas *arena_base = interpreter->arena_base;
  -    int j;
       /* XXX these should go into the interpreter */
       int total_free = 0;
   
  
  
  
  1.20      +1 -2      parrot/src/gc_ims.c
  
  Index: gc_ims.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/gc_ims.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- gc_ims.c  25 Jan 2005 14:47:32 -0000      1.19
  +++ gc_ims.c  9 Apr 2005 08:21:27 -0000       1.20
  @@ -743,7 +743,6 @@
   parrot_gc_ims_collect(Interp* interpreter, int check_only)
   {
       struct Arenas *arena_base = interpreter->arena_base;
  -    struct Memory_Block *block;
       Gc_ims_private *g_ims;
       int ret;
   
  
  
  
  1.62      +1 -3      parrot/src/global_setup.c
  
  Index: global_setup.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/global_setup.c,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- global_setup.c    4 Apr 2005 14:02:22 -0000       1.61
  +++ global_setup.c    9 Apr 2005 08:21:27 -0000       1.62
  @@ -47,8 +47,6 @@
   void
   init_world(Interp *interpreter)
   {
  -    INTVAL i;
  -
       PMC *iglobals;
       PMC *self;
   
  
  
  
  1.67      +1 -3      parrot/src/headers.c
  
  Index: headers.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/headers.c,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- headers.c 26 Jan 2005 17:13:52 -0000      1.66
  +++ headers.c 9 Apr 2005 08:21:27 -0000       1.67
  @@ -735,8 +735,6 @@
   void
   Parrot_destroy_header_pools(Interp *interpreter)
   {
  -    struct Small_Object_Pool *pool;
  -    struct Small_Object_Arena *cur_arena, *next;
       int pass, start;
   
       /* const/non const COW strings life in different pools
  
  
  
  1.69      +1 -5      parrot/src/mmd.c
  
  Index: mmd.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/mmd.c,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- mmd.c     8 Apr 2005 10:17:14 -0000       1.68
  +++ mmd.c     9 Apr 2005 08:21:27 -0000       1.69
  @@ -1444,8 +1444,6 @@
   {
       const char *name;
       STRING *s, *ns;
  -    int len;
  -    char *p;
       PMC *multi;
   
       name = Parrot_MMD_methode_name(interpreter, func_nr);
  @@ -1463,8 +1461,6 @@
       const char *short_name;
       char signature[6], val_sig;
       STRING *meth_name, *ns, *_sub;
  -    int len;
  -    char *p;
       PMC *method, *multi, *class, *multi_sig;
   
       assert (type != enum_class_Null && type != enum_class_delegate &&
  
  
  
  1.9       +1 -3      parrot/src/mmd_fallback.c
  
  Index: mmd_fallback.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/mmd_fallback.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mmd_fallback.c    8 Apr 2005 10:17:14 -0000       1.8
  +++ mmd_fallback.c    9 Apr 2005 08:21:27 -0000       1.9
  @@ -589,8 +589,6 @@
   
   void
   register_fallback_methods(Parrot_Interp interp) {
  -    INTVAL i;
  -
       /* Yeah, this first one's out of order logically, but it means
          the table doesn't have to keep being re-malloc'd */
       assert(MMD_REPEAT == MMD_USER_FIRST - 1);
  
  
  
  1.102     +1 -2      parrot/src/pmc.c
  
  Index: pmc.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/pmc.c,v
  retrieving revision 1.101
  retrieving revision 1.102
  diff -u -r1.101 -r1.102
  --- pmc.c     8 Apr 2005 10:17:14 -0000       1.101
  +++ pmc.c     9 Apr 2005 08:21:27 -0000       1.102
  @@ -70,7 +70,6 @@
             UINTVAL flags)
   {
       INTVAL has_ext = 0, new_flags = 0;
  -    PMC_EXT hold_ext;
   
       if (pmc->vtable->base_type == new_type)
           return pmc;
  
  
  
  1.35      +1 -2      parrot/src/pmc_freeze.c
  
  Index: pmc_freeze.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/pmc_freeze.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- pmc_freeze.c      20 Mar 2005 10:16:49 -0000      1.34
  +++ pmc_freeze.c      9 Apr 2005 08:21:27 -0000       1.35
  @@ -1298,7 +1298,6 @@
   static void
   visit_todo_list_thaw(Parrot_Interp interpreter, PMC* old, visit_info* info)
   {
  -    int seen;
       do_thaw(interpreter, old, info);
   }
   
  
  
  
  1.248     +3 -1      parrot/src/string.c
  
  Index: string.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/string.c,v
  retrieving revision 1.247
  retrieving revision 1.248
  diff -u -r1.247 -r1.248
  --- string.c  6 Apr 2005 10:27:56 -0000       1.247
  +++ string.c  9 Apr 2005 08:21:27 -0000       1.248
  @@ -274,12 +274,14 @@
   string_init(Parrot_Interp interpreter)
   {
       size_t i;
  +#if PARROT_HAS_ICU
       char *data_dir;
       int free_data_dir = 0;
       union {
           const void * __c_ptr;
           void * __ptr;
       } __ptr_u;
  +#endif
   
       if (!interpreter->parent_interpreter) {
           /* Load in the basic encodings and charsets
  
  
  
  1.89      +1 -2      parrot/src/sub.c
  
  Index: sub.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/sub.c,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- sub.c     14 Mar 2005 14:45:40 -0000      1.88
  +++ sub.c     9 Apr 2005 08:21:27 -0000       1.89
  @@ -172,7 +172,6 @@
       struct Parrot_coro* co = PMC_coro(sub);
       struct Parrot_Context *ctx = &co->ctx;
       struct Parrot_Context temp;
  -    struct parrot_regs_t *reg_p;
   
       /*
        * Swap context structures
  
  
  
  1.31      +2 -2      parrot/src/thread.c
  
  Index: thread.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/thread.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- thread.c  18 Nov 2004 11:14:25 -0000      1.30
  +++ thread.c  9 Apr 2005 08:21:27 -0000       1.31
  @@ -424,7 +424,7 @@
           if (thread_interp->thread_data->state == THREAD_STATE_JOINABLE ||
               (thread_interp->thread_data->state & THREAD_STATE_FINISHED)) {
   
  -            void *retval;
  +            void *retval = NULL;
               thread_interp->thread_data->state |= THREAD_STATE_JOINED;
               UNLOCK(interpreter_array_mutex);
               JOIN(thread_interp->thread_data->thread, retval);
  
  
  
  1.19      +3 -5      parrot/src/utils.c
  
  Index: utils.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/utils.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- utils.c   27 Feb 2005 11:03:43 -0000      1.18
  +++ utils.c   9 Apr 2005 08:21:27 -0000       1.19
  @@ -647,7 +647,7 @@
           const STRING *search, UINTVAL start_offset)
   {
       INTVAL pos = -1;
  -    char *base_start, *search_start, *current_pos;
  +    char *base_start, *search_start;
       INTVAL current_offset;
       INTVAL max_possible_offset;
       INTVAL found = 0;
  @@ -655,7 +655,6 @@
       search_start = search->strstart;
       max_possible_offset = (base->strlen - search->strlen);
   
  - checkloop:
       for (current_offset = start_offset; current_offset <= 
max_possible_offset;
               current_offset++) {
           base_start = (char *)base->strstart + current_offset;
  @@ -676,7 +675,7 @@
           const STRING *search, UINTVAL start_offset)
   {
       INTVAL pos = -1;
  -    char *base_start, *search_start, *current_pos;
  +    char *base_start, *search_start;
       INTVAL current_offset;
       UINTVAL max_possible_offset;
       INTVAL found = 0;
  @@ -686,7 +685,6 @@
       if (start_offset && start_offset < max_possible_offset) {
           max_possible_offset = start_offset;
       }
  - checkloop:
       for (current_offset = max_possible_offset; current_offset >= 0;
               current_offset--) {
           base_start = (char *)base->strstart + current_offset;
  
  
  

Reply via email to