[Monetdb-developers] [Monetdb-pf-checkins] pathfinder/src/sqlhelpers/xmlshred xmlshred.c, , 1.2, 1.3

Manuel Mayr mayrm at in.tum.de
Mon Sep 10 13:25:54 CEST 2007


Thx for the suggestion,
I see SSZFMT to be defined in monet_utils.h. 
Is it possible to use SSZFMT without creating a dependency to monet?

Best regards,
    Manuel

Sjoerd Mullender wrote:
> When printing a value of type size_t, use SZFMT.  When printing a value
> of type ssize_t, use SSZFMT.  The format needed to print these values
> varies from system to system, so that difference is hidden in a macro.
>
> Manuel Mayr wrote:
>   
>> Update of /cvsroot/monetdb/pathfinder/src/sqlhelpers/xmlshred
>> In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13392
>>
>> Modified Files:
>> 	xmlshred.c 
>> Log Message:
>>
>>
>> Thx for noting.
>>
>>
>> Index: xmlshred.c
>> ===================================================================
>> RCS file: /cvsroot/monetdb/pathfinder/src/sqlhelpers/xmlshred/xmlshred.c,v
>> retrieving revision 1.2
>> retrieving revision 1.3
>> diff -u -d -r1.2 -r1.3
>> --- xmlshred.c	9 Sep 2007 08:27:39 -0000	1.2
>> +++ xmlshred.c	10 Sep 2007 06:55:38 -0000	1.3
>> @@ -51,8 +51,7 @@
>>  
>>  #define NAME_ID 0
>>  
>> -typedef long unsigned int nat;
>> -typedef int pre_t;
>> +typedef ssize_t nat;
>>  
>>  enum kind_t {
>>        elem
>> @@ -138,8 +137,8 @@
>>  
>>  typedef struct node_t node_t;
>>  struct node_t {
>> -    pre_t     pre;
>> -    pre_t     apre;
>> +    nat     pre;
>> +    nat     apre;
>>      nat       post;
>>      nat       pre_stretched;
>>      nat       post_stretched;
>> @@ -155,7 +154,7 @@
>>  static node_t stack[STACK_MAX];
>>  static int level;
>>  static int max_level;
>> -static pre_t pre;
>> +static nat pre;
>>  static nat post;
>>  static nat rank;
>>  static nat att_id;
>> @@ -346,7 +345,7 @@
>>                      attr_guide_node = insert_guide_node((char*)atts_back[0],
>>                          current_guide_node, attr);
>>  
>> -                fprintf (out_attr, "%lu, %i, \"%s\", \"%s\", %lu\n", 
>> +                fprintf (out_attr, "%i, %i, \"%s\", \"%s\", %i\n", 
>>                      att_id++, pre, (char*)atts[0], (char*)atts[1], attr_guide_node->guide);
>>  
>>                  atts += 2;
>> @@ -602,10 +601,10 @@
>>  		    case 'e':  if(tuple.pre != -1)
>>  				       fprintf (out, "%i", tuple.pre);
>>  			       break;
>> -		    case 'o':  fprintf (out, "%lu", tuple.post); break;
>> -		    case 'E':  fprintf (out, "%lu", tuple.pre_stretched); break;
>> -		    case 'O':  fprintf (out, "%lu", tuple.post_stretched); break;
>> -		    case 's':  fprintf (out, "%lu", tuple.size); break;
>> +		    case 'o':  fprintf (out, "%i", tuple.post); break;
>> +		    case 'E':  fprintf (out, "%i", tuple.pre_stretched); break;
>> +		    case 'O':  fprintf (out, "%i", tuple.post_stretched); break;
>> +		    case 's':  fprintf (out, "%i", tuple.size); break;
>>  		    case 'l':  fprintf (out, "%u",  tuple.level); break;
>>  
>>  		    case 'p':  
>> @@ -616,7 +615,7 @@
>>  			       break;
>>  		    case 'P':
>>  			       if (tuple.parent)
>> -				       fprintf (out, "%lu",tuple.parent->pre_stretched);
>> +				       fprintf (out, "%i",tuple.parent->pre_stretched);
>>  			       else
>>  				       fprintf (out, "NULL");
>>  			       break;
>> @@ -653,7 +652,7 @@
>>  				       fprintf(out, "NULL");
>>  			       }
>>  	     break;    
>> -                                        case 'g':  fprintf (out, "%lu", tuple.guide); break;
>> +                                        case 'g':  fprintf (out, "%i", tuple.guide); break;
>>  
>>                                          default:   putc (format[i], out); break;
>>                          }
>> @@ -966,7 +965,7 @@
>>      /* print the node self */
>>      fprintf (
>>          guide_out, 
>> -        "<node guide=\"%lu\" count=\"%lu\" kind=\"",
>> +        "<node guide=\"%i\" count=\"%i\" kind=\"",
>>          root->guide,
>>          root->count);
>>      print_kind (guide_out, root->kind);
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2005.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Monetdb-pf-checkins mailing list
>> Monetdb-pf-checkins at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins
>>     
>
>
>   
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Monetdb-pf-checkins mailing list
> Monetdb-pf-checkins at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins
>   


-- 
Manuel Mayr, Dipl. Inf.
Institut fuer Informatik, TU Muenchen
Tel.: +49 89 289-17259





More information about the developers-list mailing list