1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

remove old float type entirely

This commit is contained in:
Alexander Medvednikov
2019-06-25 21:36:44 +02:00
parent a911146182
commit f26e65a943
10 changed files with 80 additions and 98 deletions

View File

@ -13,7 +13,7 @@ module json
#include "cJSON.h"
struct C.cJSON {
valueint int
valuedouble float
valuedouble f32
valuestring byteptr
}
@ -54,13 +54,6 @@ fn jsdecode_i64(root *C.cJSON) i64 {
return i64(root.valuedouble) //i64 is double in C
}
fn jsdecode_float(root *C.cJSON) float {
if isnil(root) {
return 0
}
return root.valuedouble
}
fn jsdecode_f32(root *C.cJSON) f32 {
if isnil(root) {
return f32(0)
@ -116,10 +109,6 @@ fn jsencode_i64(val i64) *C.cJSON {
return C.cJSON_CreateNumber(val)
}
fn jsencode_float(val float) *C.cJSON {
return C.cJSON_CreateNumber(val)
}
fn jsencode_f32(val f32) *C.cJSON {
return C.cJSON_CreateNumber(val)
}