Fossil SCM
Allow i64 type to be used in JSON in more places, mainly for time values and file sizes.
Commit
f89a32d7820a13b5b82245d583b29e028b1efcf2
Parent
0a7af8d3a87cc96…
6 files changed
+1
-1
+1
-1
+3
-3
+3
-3
+2
-2
+2
-2
+1
-1
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -267,11 +267,11 @@ | ||
| 267 | 267 | v = cson_value_new_string(zStr, strlen(zStr)); |
| 268 | 268 | free(zStr); |
| 269 | 269 | return v; |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | -cson_value * json_new_int( int v ){ | |
| 272 | +cson_value * json_new_int( i64 v ){ | |
| 273 | 273 | return cson_value_new_integer((cson_int_t)v); |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /* |
| 277 | 277 | ** Gets a POST/POST.payload/GET/COOKIE/ENV value. The returned memory |
| 278 | 278 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -267,11 +267,11 @@ | |
| 267 | v = cson_value_new_string(zStr, strlen(zStr)); |
| 268 | free(zStr); |
| 269 | return v; |
| 270 | } |
| 271 | |
| 272 | cson_value * json_new_int( int v ){ |
| 273 | return cson_value_new_integer((cson_int_t)v); |
| 274 | } |
| 275 | |
| 276 | /* |
| 277 | ** Gets a POST/POST.payload/GET/COOKIE/ENV value. The returned memory |
| 278 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -267,11 +267,11 @@ | |
| 267 | v = cson_value_new_string(zStr, strlen(zStr)); |
| 268 | free(zStr); |
| 269 | return v; |
| 270 | } |
| 271 | |
| 272 | cson_value * json_new_int( i64 v ){ |
| 273 | return cson_value_new_integer((cson_int_t)v); |
| 274 | } |
| 275 | |
| 276 | /* |
| 277 | ** Gets a POST/POST.payload/GET/COOKIE/ENV value. The returned memory |
| 278 |
+1
-1
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -267,11 +267,11 @@ | ||
| 267 | 267 | v = cson_value_new_string(zStr, strlen(zStr)); |
| 268 | 268 | free(zStr); |
| 269 | 269 | return v; |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | -cson_value * json_new_int( int v ){ | |
| 272 | +cson_value * json_new_int( i64 v ){ | |
| 273 | 273 | return cson_value_new_integer((cson_int_t)v); |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /* |
| 277 | 277 | ** Gets a POST/POST.payload/GET/COOKIE/ENV value. The returned memory |
| 278 | 278 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -267,11 +267,11 @@ | |
| 267 | v = cson_value_new_string(zStr, strlen(zStr)); |
| 268 | free(zStr); |
| 269 | return v; |
| 270 | } |
| 271 | |
| 272 | cson_value * json_new_int( int v ){ |
| 273 | return cson_value_new_integer((cson_int_t)v); |
| 274 | } |
| 275 | |
| 276 | /* |
| 277 | ** Gets a POST/POST.payload/GET/COOKIE/ENV value. The returned memory |
| 278 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -267,11 +267,11 @@ | |
| 267 | v = cson_value_new_string(zStr, strlen(zStr)); |
| 268 | free(zStr); |
| 269 | return v; |
| 270 | } |
| 271 | |
| 272 | cson_value * json_new_int( i64 v ){ |
| 273 | return cson_value_new_integer((cson_int_t)v); |
| 274 | } |
| 275 | |
| 276 | /* |
| 277 | ** Gets a POST/POST.payload/GET/COOKIE/ENV value. The returned memory |
| 278 |
+3
-3
| --- src/json_artifact.c | ||
| +++ src/json_artifact.c | ||
| @@ -110,21 +110,21 @@ | ||
| 110 | 110 | cson_value * tmpV = NULL; |
| 111 | 111 | const char *zUuid = db_column_text(&q, 0); |
| 112 | 112 | const char *zUser; |
| 113 | 113 | const char *zComment; |
| 114 | 114 | char * zEUser, * zEComment; |
| 115 | - int mtime, omtime; | |
| 115 | + i64 mtime, omtime; | |
| 116 | 116 | v = cson_value_new_object(); |
| 117 | 117 | o = cson_value_get_object(v); |
| 118 | 118 | #define SET(K,V) cson_object_set(o,(K), (V)) |
| 119 | 119 | SET("type", eventTypeLabel ); |
| 120 | 120 | SET("uuid",json_new_string(zUuid)); |
| 121 | 121 | SET("isLeaf", cson_value_new_bool(is_a_leaf(rid))); |
| 122 | 122 | |
| 123 | - mtime = db_column_int(&q,1); | |
| 123 | + mtime = db_column_int64(&q,1); | |
| 124 | 124 | SET("timestamp",json_new_int(mtime)); |
| 125 | - omtime = db_column_int(&q,2); | |
| 125 | + omtime = db_column_int64(&q,2); | |
| 126 | 126 | if(omtime && (omtime!=mtime)){ |
| 127 | 127 | SET("originTime",json_new_int(omtime)); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | zUser = db_column_text(&q,3); |
| 131 | 131 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -110,21 +110,21 @@ | |
| 110 | cson_value * tmpV = NULL; |
| 111 | const char *zUuid = db_column_text(&q, 0); |
| 112 | const char *zUser; |
| 113 | const char *zComment; |
| 114 | char * zEUser, * zEComment; |
| 115 | int mtime, omtime; |
| 116 | v = cson_value_new_object(); |
| 117 | o = cson_value_get_object(v); |
| 118 | #define SET(K,V) cson_object_set(o,(K), (V)) |
| 119 | SET("type", eventTypeLabel ); |
| 120 | SET("uuid",json_new_string(zUuid)); |
| 121 | SET("isLeaf", cson_value_new_bool(is_a_leaf(rid))); |
| 122 | |
| 123 | mtime = db_column_int(&q,1); |
| 124 | SET("timestamp",json_new_int(mtime)); |
| 125 | omtime = db_column_int(&q,2); |
| 126 | if(omtime && (omtime!=mtime)){ |
| 127 | SET("originTime",json_new_int(omtime)); |
| 128 | } |
| 129 | |
| 130 | zUser = db_column_text(&q,3); |
| 131 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -110,21 +110,21 @@ | |
| 110 | cson_value * tmpV = NULL; |
| 111 | const char *zUuid = db_column_text(&q, 0); |
| 112 | const char *zUser; |
| 113 | const char *zComment; |
| 114 | char * zEUser, * zEComment; |
| 115 | i64 mtime, omtime; |
| 116 | v = cson_value_new_object(); |
| 117 | o = cson_value_get_object(v); |
| 118 | #define SET(K,V) cson_object_set(o,(K), (V)) |
| 119 | SET("type", eventTypeLabel ); |
| 120 | SET("uuid",json_new_string(zUuid)); |
| 121 | SET("isLeaf", cson_value_new_bool(is_a_leaf(rid))); |
| 122 | |
| 123 | mtime = db_column_int64(&q,1); |
| 124 | SET("timestamp",json_new_int(mtime)); |
| 125 | omtime = db_column_int64(&q,2); |
| 126 | if(omtime && (omtime!=mtime)){ |
| 127 | SET("originTime",json_new_int(omtime)); |
| 128 | } |
| 129 | |
| 130 | zUser = db_column_text(&q,3); |
| 131 |
+3
-3
| --- src/json_artifact.c | ||
| +++ src/json_artifact.c | ||
| @@ -110,21 +110,21 @@ | ||
| 110 | 110 | cson_value * tmpV = NULL; |
| 111 | 111 | const char *zUuid = db_column_text(&q, 0); |
| 112 | 112 | const char *zUser; |
| 113 | 113 | const char *zComment; |
| 114 | 114 | char * zEUser, * zEComment; |
| 115 | - int mtime, omtime; | |
| 115 | + i64 mtime, omtime; | |
| 116 | 116 | v = cson_value_new_object(); |
| 117 | 117 | o = cson_value_get_object(v); |
| 118 | 118 | #define SET(K,V) cson_object_set(o,(K), (V)) |
| 119 | 119 | SET("type", eventTypeLabel ); |
| 120 | 120 | SET("uuid",json_new_string(zUuid)); |
| 121 | 121 | SET("isLeaf", cson_value_new_bool(is_a_leaf(rid))); |
| 122 | 122 | |
| 123 | - mtime = db_column_int(&q,1); | |
| 123 | + mtime = db_column_int64(&q,1); | |
| 124 | 124 | SET("timestamp",json_new_int(mtime)); |
| 125 | - omtime = db_column_int(&q,2); | |
| 125 | + omtime = db_column_int64(&q,2); | |
| 126 | 126 | if(omtime && (omtime!=mtime)){ |
| 127 | 127 | SET("originTime",json_new_int(omtime)); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | zUser = db_column_text(&q,3); |
| 131 | 131 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -110,21 +110,21 @@ | |
| 110 | cson_value * tmpV = NULL; |
| 111 | const char *zUuid = db_column_text(&q, 0); |
| 112 | const char *zUser; |
| 113 | const char *zComment; |
| 114 | char * zEUser, * zEComment; |
| 115 | int mtime, omtime; |
| 116 | v = cson_value_new_object(); |
| 117 | o = cson_value_get_object(v); |
| 118 | #define SET(K,V) cson_object_set(o,(K), (V)) |
| 119 | SET("type", eventTypeLabel ); |
| 120 | SET("uuid",json_new_string(zUuid)); |
| 121 | SET("isLeaf", cson_value_new_bool(is_a_leaf(rid))); |
| 122 | |
| 123 | mtime = db_column_int(&q,1); |
| 124 | SET("timestamp",json_new_int(mtime)); |
| 125 | omtime = db_column_int(&q,2); |
| 126 | if(omtime && (omtime!=mtime)){ |
| 127 | SET("originTime",json_new_int(omtime)); |
| 128 | } |
| 129 | |
| 130 | zUser = db_column_text(&q,3); |
| 131 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -110,21 +110,21 @@ | |
| 110 | cson_value * tmpV = NULL; |
| 111 | const char *zUuid = db_column_text(&q, 0); |
| 112 | const char *zUser; |
| 113 | const char *zComment; |
| 114 | char * zEUser, * zEComment; |
| 115 | i64 mtime, omtime; |
| 116 | v = cson_value_new_object(); |
| 117 | o = cson_value_get_object(v); |
| 118 | #define SET(K,V) cson_object_set(o,(K), (V)) |
| 119 | SET("type", eventTypeLabel ); |
| 120 | SET("uuid",json_new_string(zUuid)); |
| 121 | SET("isLeaf", cson_value_new_bool(is_a_leaf(rid))); |
| 122 | |
| 123 | mtime = db_column_int64(&q,1); |
| 124 | SET("timestamp",json_new_int(mtime)); |
| 125 | omtime = db_column_int64(&q,2); |
| 126 | if(omtime && (omtime!=mtime)){ |
| 127 | SET("originTime",json_new_int(omtime)); |
| 128 | } |
| 129 | |
| 130 | zUser = db_column_text(&q,3); |
| 131 |
+2
-2
| --- src/json_finfo.c | ||
| +++ src/json_finfo.c | ||
| @@ -125,15 +125,15 @@ | ||
| 125 | 125 | int const isDel = db_column_int(&q,10); |
| 126 | 126 | cson_array_append( checkins, cson_object_value(row) ); |
| 127 | 127 | cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) )); |
| 128 | 128 | cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) )); |
| 129 | 129 | /*cson_object_set(row, "parentArtifact", json_new_string( db_column_text(&q,6) ));*/ |
| 130 | - cson_object_set(row, "timestamp", json_new_int( db_column_int(&q,3) )); | |
| 130 | + cson_object_set(row, "timestamp", json_new_int( db_column_int64(&q,3) )); | |
| 131 | 131 | cson_object_set(row, "user", json_new_string( db_column_text(&q,4) )); |
| 132 | 132 | cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) )); |
| 133 | 133 | /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/ |
| 134 | - cson_object_set(row, "size", cson_value_new_integer( (cson_int_t)db_column_int64(&q,8) )); | |
| 134 | + cson_object_set(row, "size", json_new_int( db_column_int64(&q,8) )); | |
| 135 | 135 | cson_object_set(row, "state", |
| 136 | 136 | json_new_string(json_artifact_status_to_string(isNew,isDel))); |
| 137 | 137 | if( (0 < limit) && (++currentRow >= limit) ){ |
| 138 | 138 | break; |
| 139 | 139 | } |
| 140 | 140 |
| --- src/json_finfo.c | |
| +++ src/json_finfo.c | |
| @@ -125,15 +125,15 @@ | |
| 125 | int const isDel = db_column_int(&q,10); |
| 126 | cson_array_append( checkins, cson_object_value(row) ); |
| 127 | cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) )); |
| 128 | cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) )); |
| 129 | /*cson_object_set(row, "parentArtifact", json_new_string( db_column_text(&q,6) ));*/ |
| 130 | cson_object_set(row, "timestamp", json_new_int( db_column_int(&q,3) )); |
| 131 | cson_object_set(row, "user", json_new_string( db_column_text(&q,4) )); |
| 132 | cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) )); |
| 133 | /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/ |
| 134 | cson_object_set(row, "size", cson_value_new_integer( (cson_int_t)db_column_int64(&q,8) )); |
| 135 | cson_object_set(row, "state", |
| 136 | json_new_string(json_artifact_status_to_string(isNew,isDel))); |
| 137 | if( (0 < limit) && (++currentRow >= limit) ){ |
| 138 | break; |
| 139 | } |
| 140 |
| --- src/json_finfo.c | |
| +++ src/json_finfo.c | |
| @@ -125,15 +125,15 @@ | |
| 125 | int const isDel = db_column_int(&q,10); |
| 126 | cson_array_append( checkins, cson_object_value(row) ); |
| 127 | cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) )); |
| 128 | cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) )); |
| 129 | /*cson_object_set(row, "parentArtifact", json_new_string( db_column_text(&q,6) ));*/ |
| 130 | cson_object_set(row, "timestamp", json_new_int( db_column_int64(&q,3) )); |
| 131 | cson_object_set(row, "user", json_new_string( db_column_text(&q,4) )); |
| 132 | cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) )); |
| 133 | /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/ |
| 134 | cson_object_set(row, "size", json_new_int( db_column_int64(&q,8) )); |
| 135 | cson_object_set(row, "state", |
| 136 | json_new_string(json_artifact_status_to_string(isNew,isDel))); |
| 137 | if( (0 < limit) && (++currentRow >= limit) ){ |
| 138 | break; |
| 139 | } |
| 140 |
+2
-2
| --- src/json_finfo.c | ||
| +++ src/json_finfo.c | ||
| @@ -125,15 +125,15 @@ | ||
| 125 | 125 | int const isDel = db_column_int(&q,10); |
| 126 | 126 | cson_array_append( checkins, cson_object_value(row) ); |
| 127 | 127 | cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) )); |
| 128 | 128 | cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) )); |
| 129 | 129 | /*cson_object_set(row, "parentArtifact", json_new_string( db_column_text(&q,6) ));*/ |
| 130 | - cson_object_set(row, "timestamp", json_new_int( db_column_int(&q,3) )); | |
| 130 | + cson_object_set(row, "timestamp", json_new_int( db_column_int64(&q,3) )); | |
| 131 | 131 | cson_object_set(row, "user", json_new_string( db_column_text(&q,4) )); |
| 132 | 132 | cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) )); |
| 133 | 133 | /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/ |
| 134 | - cson_object_set(row, "size", cson_value_new_integer( (cson_int_t)db_column_int64(&q,8) )); | |
| 134 | + cson_object_set(row, "size", json_new_int( db_column_int64(&q,8) )); | |
| 135 | 135 | cson_object_set(row, "state", |
| 136 | 136 | json_new_string(json_artifact_status_to_string(isNew,isDel))); |
| 137 | 137 | if( (0 < limit) && (++currentRow >= limit) ){ |
| 138 | 138 | break; |
| 139 | 139 | } |
| 140 | 140 |
| --- src/json_finfo.c | |
| +++ src/json_finfo.c | |
| @@ -125,15 +125,15 @@ | |
| 125 | int const isDel = db_column_int(&q,10); |
| 126 | cson_array_append( checkins, cson_object_value(row) ); |
| 127 | cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) )); |
| 128 | cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) )); |
| 129 | /*cson_object_set(row, "parentArtifact", json_new_string( db_column_text(&q,6) ));*/ |
| 130 | cson_object_set(row, "timestamp", json_new_int( db_column_int(&q,3) )); |
| 131 | cson_object_set(row, "user", json_new_string( db_column_text(&q,4) )); |
| 132 | cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) )); |
| 133 | /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/ |
| 134 | cson_object_set(row, "size", cson_value_new_integer( (cson_int_t)db_column_int64(&q,8) )); |
| 135 | cson_object_set(row, "state", |
| 136 | json_new_string(json_artifact_status_to_string(isNew,isDel))); |
| 137 | if( (0 < limit) && (++currentRow >= limit) ){ |
| 138 | break; |
| 139 | } |
| 140 |
| --- src/json_finfo.c | |
| +++ src/json_finfo.c | |
| @@ -125,15 +125,15 @@ | |
| 125 | int const isDel = db_column_int(&q,10); |
| 126 | cson_array_append( checkins, cson_object_value(row) ); |
| 127 | cson_object_set(row, "checkin", json_new_string( db_column_text(&q,1) )); |
| 128 | cson_object_set(row, "uuid", json_new_string( db_column_text(&q,2) )); |
| 129 | /*cson_object_set(row, "parentArtifact", json_new_string( db_column_text(&q,6) ));*/ |
| 130 | cson_object_set(row, "timestamp", json_new_int( db_column_int64(&q,3) )); |
| 131 | cson_object_set(row, "user", json_new_string( db_column_text(&q,4) )); |
| 132 | cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) )); |
| 133 | /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/ |
| 134 | cson_object_set(row, "size", json_new_int( db_column_int64(&q,8) )); |
| 135 | cson_object_set(row, "state", |
| 136 | json_new_string(json_artifact_status_to_string(isNew,isDel))); |
| 137 | if( (0 < limit) && (++currentRow >= limit) ){ |
| 138 | break; |
| 139 | } |
| 140 |