File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535// Get string length from compact symbol ID (defined in symbols.c)
3636i64_t symbol_strlen (i64_t compact_id );
3737
38+ // Backward compatibility macro
39+ #define SYMBOL_STRLEN (id ) symbol_strlen(id)
40+
3841typedef struct symbol_t {
3942 lit_p str ;
4043 i64_t compact_id ; // Sequential ID (0, 1, 2, ...)
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ i64_t raykx_size_obj(obj_p obj) {
5151 case - TYPE_F64 :
5252 return ISIZEOF (i8_t ) + ISIZEOF (f64_t );
5353 case - TYPE_SYMBOL :
54- return ISIZEOF (i8_t ) + SYMBOL_STRLEN (obj -> i64 ) + 1 ;
54+ return ISIZEOF (i8_t ) + symbol_strlen (obj -> i64 ) + 1 ;
5555 case - TYPE_C8 :
5656 return ISIZEOF (i8_t ) + ISIZEOF (c8_t );
5757 case - TYPE_GUID :
@@ -79,7 +79,7 @@ i64_t raykx_size_obj(obj_p obj) {
7979 l = obj -> len ;
8080 size = ISIZEOF (i8_t ) + 1 + ISIZEOF (u32_t );
8181 for (i = 0 ; i < l ; i ++ )
82- size += SYMBOL_STRLEN (AS_SYMBOL (obj )[i ]) + 1 ;
82+ size += symbol_strlen (AS_SYMBOL (obj )[i ]) + 1 ;
8383 return size ;
8484 case TYPE_LIST :
8585 l = obj -> len ;
@@ -227,7 +227,7 @@ i64_t raykx_ser_obj(u8_t *buf, obj_p obj) {
227227 return RAYKX_SER_ATOM (b , obj , f64 );
228228 case - TYPE_SYMBOL :
229229 str = str_from_symbol (obj -> i64 );
230- l = SYMBOL_STRLEN (obj -> i64 ) + 1 ;
230+ l = symbol_strlen (obj -> i64 ) + 1 ;
231231 memcpy (buf , str , l );
232232 return ISIZEOF (i8_t ) + l ;
233233 case - TYPE_GUID :
@@ -257,7 +257,7 @@ i64_t raykx_ser_obj(u8_t *buf, obj_p obj) {
257257 b = buf ;
258258 for (i = 0 , n = 0 ; i < obj -> len ; i ++ ) {
259259 str = str_from_symbol (AS_SYMBOL (obj )[i ]);
260- n = SYMBOL_STRLEN (AS_SYMBOL (obj )[i ]) + 1 ;
260+ n = symbol_strlen (AS_SYMBOL (obj )[i ]) + 1 ;
261261 memcpy (b , str , n );
262262 b += n ;
263263 }
You can’t perform that action at this time.
0 commit comments