state.c: convert LttvTraceHookByFacility to LttvTraceHook and fix other errors and...
[lttv.git] / genevent / parser.c
index 25fabab5e98245b59b2704f25d8e80659e1f5b24..7ac11e7ec8492fb683169fd5004c4cbd0fb2df18 100644 (file)
@@ -1,3 +1,6 @@
+
+
+
 /*
 
 parser.c: Generate helper declarations and functions to trace events
@@ -215,6 +218,7 @@ void getTypeAttributes(parse_file_t *in, type_descriptor_t *t,
     if(!strcmp("format",token)) {
       getEqual(in);
       t->fmt = allocAndCopy(getQuotedString(in));
+      // printf("%s - ",t->fmt);
     //} else if(!strcmp("name",token)) {
      // getEqual(in);
      // car = seekNextChar(in);
@@ -436,7 +440,7 @@ char *getNameAttribute(parse_file_t *in)
 //Return value : 0 : no value,   1 : has a value
 int getValueAttribute(parse_file_t *in, long long *value)
 {
-  char * token, *token2;
+  char * token, * endptr;
 
   token = getToken(in);
 
@@ -449,24 +453,12 @@ int getValueAttribute(parse_file_t *in, long long *value)
   getEqual(in);
   token = getToken(in);
 
-  if(in->type == QUOTEDSTRING) {
-    in->type = NUMBER;
-    token2 = token;
-    do {
-      if (!isdigit(*token2)) {
-          in->type = QUOTEDSTRING;
-          break;
-      }
-    } while (*(++token2) != '\0');
-  }
-
-  if(in->type == NUMBER)
-    *value = strtoll(token, NULL, 0);
-  else
+  *value = strtoll(token, &endptr, 0);
+  if(*endptr != '\0')
     goto error;
   return 1;
 error:
-  in->error(in,"incorrect size specification");
+  in->error(in,"invalid number specified");
   return 0;
 }
 
@@ -1486,7 +1478,9 @@ unsigned long getTypeChecksum(unsigned long aCrc, type_descriptor_t * type)
   crc = partial_crc32(str,crc);
   if(flag) free(str);
 
-  if(type->fmt) crc = partial_crc32(type->fmt,crc);
+  //the format string is not included in the crc calculation
+
+  //if(type->fmt) crc = partial_crc32(type->fmt,crc);
 
   if(type->type == ARRAY){
     crc = getTypeChecksum(crc,((field_t*)type->fields.array[0])->type);
This page took 0.024037 seconds and 4 git commands to generate.