pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:218:    int q; \    code_entry(TAG_STRING,-1, data); \    code_entry((S)->size_shift, (S)->len, data); \    ENCODE_DATA(S); \    }else{ \    code_entry(TAG_STRING, (S)->len, data); \    addstr((char *)((S)->str),(S)->len); \    } \   }while(0)    - /* Like adddata, but allows null pointers */ -  - #define adddata3(S) do { \ -  if(S) { \ -  adddata(S); \ -  } else { \ -  code_entry(TAG_INT, 0, data); \ -  } \ - }while(0) -  +    #define adddata2(s,l) addstr((char *)(s),(l) * sizeof((s)[0]));      #ifdef ENCODE_DEBUG   /* NOTE: Fix when type encodings change. */   static int tag_to_type(int tag)   {    if (tag == TAG_FLOAT) return T_FLOAT;    if (tag == TAG_TYPE) return T_TYPE;    if (tag <= MAX_TYPE) return tag ^ MIN_REF_TYPE;    return tag;
pike.git/src/encode.c:2088:   #define decode_entry(X,Y,Z) \    do { \    INT32 what, e; \    INT64 num; \    DECODE("decode_entry"); \    if((what & TAG_MASK) != (X)) \    decode_error(data, NULL, "Wrong bits (%d).\n", what & TAG_MASK); \    (Y)=num; \    } while(0);    - #define getdata2(S,L) do { \ -  if(sizeof(S[0])*(L) > (size_t)(data->len - data->ptr)) \ -  decode_error(data, NULL, "String range error.\n"); \ -  MEMCPY((S),(data->data + data->ptr), sizeof(S[0])*(L)); \ -  data->ptr+=sizeof(S[0])*(L); \ -  }while(0) -  +    #if PIKE_BYTEORDER == 4321   #define BITFLIP(S)   #else   #define BITFLIP(S) \    switch(what) \    { \    case 1: for(e=0;e<num;e++) STR1(S)[e]=ntohs(STR1(S)[e]); break; \    case 2: for(e=0;e<num;e++) STR2(S)[e]=ntohl(STR2(S)[e]); break; \    }   #endif