Changeset 28 for trunk/src/template.c

Show
Ignore:
Timestamp:
04/11/07 14:55:42 (16 years ago)
Author:
andreu
Message:

debug mode in compilation option - Wno-long-long - copyright update

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/template.c

    r27 r28  
    22 * File: template.c 
    33 *  
    4  * Authors: ANDREU François-Xavier  
    5  * 
    6  * Copyright (C) 2005 GIP RENATER  
     4 * Authors: ANDREU Francois-Xavier  
     5 * 
     6 * Copyright (C) 2005 2006 2007 GIP RENATER  
    77 */ 
    88 
     
    8585  length = *((unsigned short*)&buffer2); 
    8686  do { 
    87     fprintf (stderr, " TD \n"); 
     87#ifdef DEBUG     
     88    fprintf (stderr, "<\n"); 
     89    fprintf (stderr, "length %d \n", length);   
     90#endif 
    8891    badFieldNumber = 0; 
    8992    badFieldLength = 0; 
     
    160163          return (-1); 
    161164        } 
    162         fprintf (stderr, "t for new \n"); 
    163165      } 
    164166    } else { /*update*/ 
     
    236238          return (-1);     
    237239        } 
    238         fprintf (stderr, "t for up \n"); 
    239240      } 
    240241    } /* end if template creation or update */ 
     
    279280    (*cFNPtr)++;     
    280281  } while ( (cpt) < (length-2) ); /*length-2*/ 
     282#ifdef DEBUG 
     283  fprintf (stderr, "length returned %d, cpt=%d\n", length, cpt);   
     284  fprintf (stderr, ">\n"); 
     285#endif 
    281286  return length; 
    282287} 
     
    293298{ 
    294299  int i; 
    295   static int cpt = 0;  
    296   static unsigned short getFlowsetId = 0; 
    297   static unsigned short length = 0; 
     300  int cpt = 0;  
     301  unsigned short getFlowsetId = 0; 
     302  unsigned short length = 0; 
    298303  unsigned char buffer2[2]; 
    299304  TplOptionPtr ptplotmp; 
     
    309314  length = *((unsigned short*)&buffer2); 
    310315  do { 
    311     fprintf (stderr, " TO \n"); 
     316#ifdef DEBUG     
     317    fprintf (stderr, "<o\n"); 
     318#endif 
    312319    badFieldNumber = 0; 
    313320    badFieldLength = 0; 
     
    353360          syslog (LOG_INFO,  
    354361                  "in option template function: too many fields, bug collector or wrong template def in template update"); 
     362#ifdef DEBUG 
    355363          fprintf(stderr, 
    356364                  "\nin option template function: too many fields, bug collector or wrong template def in template update\n"); 
     365#endif 
    357366          ptplotmp = cTOPtr; 
    358367          if (ptplotmp->prev == NULL) { 
     
    371380          return (-1); 
    372381        } 
    373         fprintf (stderr, "to for new \n"); 
    374382      } 
    375383      while ((*offV9)%4 != 0) { 
    376384        (*offV9)++; cpt++; 
    377         fprintf (stderr, " TO new padding \n"); 
    378385      } /*padding case*/ 
    379386    } else { /*update */ 
     
    428435          syslog (LOG_INFO,  
    429436                  "in update option tpl function: too many fields, bug collector or wrong template def in template update"); 
     437#ifdef DEBUG 
    430438          fprintf(stderr, 
    431439                  "\nin update option tpl function: too many fields, bug collector or wrong template def in template update\n"); 
     440#endif 
    432441          ptplotmp = cTOPtr; 
    433442          if (ptplotmp->prev == NULL) { 
     
    446455          return (-1); 
    447456        } 
    448         fprintf (stderr, "to for up \n"); 
    449457      } 
    450458      while ((*offV9)%4 != 0) { 
    451459        (*offV9)++; cpt++; 
    452         fprintf (stderr, " TO update padding \n"); 
    453460      } /*padding case*/ 
    454461    } 
     
    456463  } while ((cpt) < (length-2)); 
    457464/*   show_all_tplFlSet(); */ 
    458   fprintf (stderr, "to return %d \n", length); 
     465#ifdef DEBUG 
     466  fprintf (stderr, "length returned %d, cpt=%d\n", length, cpt);   
     467  fprintf (stderr, ">\n"); 
     468#endif 
    459469  return length; 
    460470}