[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: gsymcheck.c



  User: ahvezda 
  Date: 06/07/15 22:18:46

  Modified:    .        gsymcheck.c s_check.c s_symstruct.c
  Log:
  Changed all malloc/free calls to g_malloc/g_free to be consistent with libgeda
  
  
  
  
  Revision  Changes    Path
  1.39      +2 -2      eda/geda/gaf/gsymcheck/src/gsymcheck.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: gsymcheck.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gsymcheck/src/gsymcheck.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -b -r1.38 -r1.39
  --- gsymcheck.c	9 Apr 2006 10:54:22 -0000	1.38
  +++ gsymcheck.c	16 Jul 2006 02:18:46 -0000	1.39
  @@ -137,7 +137,7 @@
           s_log_message("gsymcheck: Could not load [%s]\n", 
                         pr_current->page_current->page_filename);
           s_log_message("Exiting...\n");
  -        exit(2); // error 
  +        exit(2); /* error */
         }
       }
       i++;
  @@ -149,7 +149,7 @@
       usage(argv[0]);
     }
   
  -  free(cwd);
  +  free(cwd); /* allocated with getcwd, should stay as free */
   
     logging_dest=STDOUT_TTY;
   
  
  
  
  1.24      +27 -27    eda/geda/gaf/gsymcheck/src/s_check.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: s_check.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gsymcheck/src/s_check.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -b -r1.23 -r1.24
  --- s_check.c	27 Sep 2005 22:51:18 -0000	1.23
  +++ s_check.c	16 Jul 2006 02:18:46 -0000	1.24
  @@ -180,7 +180,7 @@
   
     if (temp) {
       s_current->graphical_symbol=TRUE;
  -    free(temp);
  +    g_free(temp);
     }
   }
   
  @@ -203,7 +203,7 @@
       /* found device= attribute */
       s_current->missing_device_attrib=FALSE;
       s_current->device_attribute =
  -      (char *) malloc(sizeof(char)*(strlen(temp)+1));
  +      (char *) g_malloc(sizeof(char)*(strlen(temp)+1));
       strcpy(s_current->device_attribute, temp);
       message = g_strdup_printf ("Found device=%s\n", temp);
       s_current->info_messages = g_list_append(s_current->info_messages,
  @@ -225,7 +225,7 @@
     } 
   
     if (temp) 
  -    free(temp);
  +    g_free(temp);
   }
   
   
  @@ -293,7 +293,7 @@
             s_current->error_count++;
           }
   
  -        free(string);
  +        g_free(string);
           
           /* this is the first attribute found */
           if (!found_first) {
  @@ -301,7 +301,7 @@
             found_first=TRUE;
           } else {
             if (number)
  -            free(number);
  +            g_free(number);
           }
           
           counter++;
  @@ -352,7 +352,7 @@
     ptr1 = found_numbers;
     while (ptr1)
     {
  -    free(ptr1->data);
  +    g_free(ptr1->data);
       ptr1 = ptr1->next;
     }
     g_list_free(found_numbers);
  @@ -397,7 +397,7 @@
                                                 message);
         s_current->error_count++;
       
  -      free(net);
  +      g_free(net);
         counter++;
         continue;
       }
  @@ -405,7 +405,7 @@
       j = 0;
       do {
         if (number) {
  -        free(number);
  +        g_free(number);
           number = NULL;
         }
           
  @@ -436,11 +436,11 @@
       } while (number);
   
       if (number)
  -      free(number);
  +      g_free(number);
   
   
  -    free(net);
  -    free(netpins);
  +    g_free(net);
  +    g_free(netpins);
       
       counter++;
     }
  @@ -487,7 +487,7 @@
           }
           
           number = g_strdup (string);
  -        free(string);
  +        g_free(string);
   
           if (strcmp(number, "0") == 0) {
             message = g_strdup ("Found pinnumber=0 attribute\n");
  @@ -502,7 +502,7 @@
             found_first=TRUE;
           } else {
             if (number)
  -            free(number);
  +            g_free(number);
   	}
           
           counter++;
  @@ -555,7 +555,7 @@
     ptr1 = found_numbers;
     while (ptr1)
     {
  -    free(ptr1->data);
  +    g_free(ptr1->data);
       ptr1 = ptr1->next;
     }
     g_list_free(found_numbers);
  @@ -599,7 +599,7 @@
   
     s_current->numslots=atoi(value);
     sprintf(numslots_str, "%d", s_current->numslots);
  -  free(value);
  +  g_free(value);
   
     message = g_strdup_printf ("Found numslots=%s attribute\n", numslots_str);
     s_current->info_messages = g_list_append(s_current->info_messages,
  @@ -645,7 +645,7 @@
                                                   message);
         s_current->error_count++;
         s_current->slotting_errors++;
  -      free(slotdef);
  +      g_free(slotdef);
         return;
       }
   
  @@ -659,7 +659,7 @@
       }
     
       slot = atoi(slotnum);
  -    free(slotnum);
  +    g_free(slotnum);
   
       /* make sure that the slot # is less than the number of slots */
       if (slot > s_current->numslots) {
  @@ -684,7 +684,7 @@
                                                   message);
         s_current->error_count++;
         s_current->slotting_errors++;
  -      free(slotdef);
  +      g_free(slotdef);
         return;
       }
       pins++;  /* get past that : */
  @@ -696,7 +696,7 @@
                                                   message);
         s_current->error_count++;
         s_current->slotting_errors++;
  -      free(slotdef);
  +      g_free(slotdef);
         return;
       }
   
  @@ -708,14 +708,14 @@
                                                   message);
         s_current->error_count++;
         s_current->slotting_errors++;
  -      free(slotdef);
  +      g_free(slotdef);
         return;
       }
   
       j = 0;
       do {
         if (temp) {
  -        free(temp);
  +        g_free(temp);
           temp = NULL;
         }
           
  @@ -740,7 +740,7 @@
   	    			                  message);
           s_current->error_count++;
           s_current->slotting_errors++;
  -        free(temp);
  +        g_free(temp);
           temp = NULL;
           break;
         }
  @@ -758,9 +758,9 @@
       } while (temp);
   
       if (temp)
  -      free(temp);
  +      g_free(temp);
   
  -    free(slotdef);
  +    g_free(slotdef);
      
       i++;
       slotdef = o_attrib_search_name(object_head, "slotdef", i);
  @@ -1109,7 +1109,7 @@
         found_first=TRUE;
       }
   
  -    free(string);
  +    g_free(string);
   
       counter++;
       string = o_attrib_search_name_single_count(object, attribute,
  @@ -1299,10 +1299,10 @@
   /*           s_current->error_count++; */
   /*         } */
   
  -        free(string);
  +        g_free(string);
           
   	if (pintype)
  -	  free(pintype);
  +	  g_free(pintype);
           
           counter++;
           string = o_attrib_search_name_single_count(o_current, "pintype",
  
  
  
  1.13      +6 -6      eda/geda/gaf/gsymcheck/src/s_symstruct.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: s_symstruct.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gsymcheck/src/s_symstruct.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- s_symstruct.c	9 Feb 2005 19:13:32 -0000	1.12
  +++ s_symstruct.c	16 Jul 2006 02:18:46 -0000	1.13
  @@ -36,7 +36,7 @@
   {
     SYMCHECK *s_symcheck;
   	
  -  s_symcheck = (SYMCHECK *) malloc(sizeof(SYMCHECK));
  +  s_symcheck = (SYMCHECK *) g_malloc(sizeof(SYMCHECK));
   
     s_symcheck->info_messages = NULL;
     s_symcheck->warning_messages = NULL;
  @@ -97,7 +97,7 @@
         /* printf("found info: %s\n", msg); */
         if (msg) { 
           s_log_message("Info: %s", msg);
  -        free(msg);
  +        g_free(msg);
         }
   
         list = list->next;
  @@ -112,7 +112,7 @@
         /* printf("found warning: %s\n", msg); */
         if (msg) { 
           s_log_message("Warning: %s", msg);
  -        free(msg);
  +        g_free(msg);
         }
   
         list = list->next;
  @@ -127,7 +127,7 @@
         /* printf("found error: %s\n", msg); */
         if (msg && verbose_mode) { 
           s_log_message("ERROR: %s", msg);
  -        free(msg);
  +        g_free(msg);
         }
   
         list = list->next;
  @@ -141,9 +141,9 @@
     if (s_current) {
   
       if (s_current->device_attribute) {
  -      free(s_current->device_attribute);
  +      g_free(s_current->device_attribute);
       }
   
  -    free(s_current);
  +    g_free(s_current);
     }
   }
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs