aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2021-10-02 23:29:59 +0200
committerDaniel Gavin <danielgavin5@hotmail.com>2021-10-02 23:29:59 +0200
commit6aa45d7c84b1b151da90e074f856ef193c9bbd66 (patch)
tree56b38ec98d24853654fe5b493a3771d2e4261262 /src
parent893540ee2e9573720ab379deaa4d595926abefe3 (diff)
Fix new the odin json version.
Diffstat (limited to 'src')
-rw-r--r--src/server/response.odin6
-rw-r--r--src/server/unmarshal.odin6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/server/response.odin b/src/server/response.odin
index 4e5b680..0d9cf2e 100644
--- a/src/server/response.odin
+++ b/src/server/response.odin
@@ -9,7 +9,7 @@ send_notification :: proc (notification: Notification, writer: ^Writer) -> bool
header := fmt.tprintf("Content-Length: {}\r\n\r\n", len(data));
- if error != json.Marshal_Error.None {
+ if error != .None {
return false;
}
@@ -30,7 +30,7 @@ send_response :: proc (response: ResponseMessage, writer: ^Writer) -> bool {
header := fmt.tprintf("Content-Length: {}\r\n\r\n", len(data));
- if error != json.Marshal_Error.None {
+ if error != .None {
return false;
}
@@ -51,7 +51,7 @@ send_error :: proc (response: ResponseMessageError, writer: ^Writer) -> bool {
header := fmt.tprintf("Content-Length: {}\r\n\r\n", len(data));
- if error != json.Marshal_Error.None {
+ if error != .None {
return false;
}
diff --git a/src/server/unmarshal.odin b/src/server/unmarshal.odin
index fac57da..359d7ab 100644
--- a/src/server/unmarshal.odin
+++ b/src/server/unmarshal.odin
@@ -73,7 +73,7 @@ unmarshal :: proc(json_value: json.Value, v: any, allocator: mem.Allocator) -> j
array.cap = len(j);
array.allocator = allocator;
} else {
- return .Invalid_Data;
+ return .Unsupported_Type;
}
for i in 0..<array.len {
@@ -127,7 +127,7 @@ unmarshal :: proc(json_value: json.Value, v: any, allocator: mem.Allocator) -> j
tmp := i8(j);
mem.copy(v.data, &tmp, type_info.size);
case:
- return .Invalid_Data;
+ return .Unsupported_Type;
}
case Type_Info_Union:
tag_ptr := uintptr(v.data) + variant.tag_offset;
@@ -142,7 +142,7 @@ unmarshal :: proc(json_value: json.Value, v: any, allocator: mem.Allocator) -> j
tmp := f32(j);
mem.copy(v.data, &tmp, type_info.size);
case:
- return .Invalid_Data;
+ return .Unsupported_Type;
}
}
case json.Null: