Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/hello/first.jai
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ main :: () {
ws.send(ws, "SERVER: Welcome to the chat room! Open another tab to chat.");
mylog("new websocket connected");
};
ws_server.onclose = (ws: *Websocket) {; mylog("websocket closed", <<ws); };
ws_server.onclose = (ws: *Websocket) {; mylog("websocket closed", ws.*); };
ws_server.onmsg = (ws: *Websocket, msg: string) {
ws.broadcast(ws, msg); // broadcasts the message to all other connected websockets
ws.send(ws, msg); // let's echo the msg back to ourself aswell
Expand Down
2 changes: 1 addition & 1 deletion module.jai
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Request :: struct {
}

get_param :: (request: *Request, name: string) -> string {
val, found := table_find(*request.params, name);
found, val := table_find(*request.params, name);
if !found return "";
return val;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/brotli/module.jai
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ using BrotliEncoderMode :: enum s32 {BROTLI_MODE_GENERIC :: 0; BROTLI_MODE_TEXT
encoded_size: *size_t,
encoded_buffer: *u8
) -> BROTLI_BOOL {
<<encoded_size = 0;
encoded_size.* = 0;
return 0;
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/mybasic/module.jai
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using Basic :: #import "Basic";
mylog :: (args: ..Any) {for args print("% ", it); print("\n"); }
die :: (args: ..Any) {mylog("[die]"); mylog(..args); exit(1); }

unsafe_cast :: (val: *$T, $type: Type) -> type #expand {return <<cast(*type)(val); }
unsafe_cast :: (val: *$T, $type: Type) -> type #expand {return (.*)cast(*type)(val); }
Cast :: (val: $T, $type: Type) -> type #expand {return cast(type)(val); }

default_allocator :: context.default_allocator;
Expand All @@ -27,7 +27,7 @@ push_tallocator :: () #expand {

tjoin :: #bake_arguments join(,,allocator=tallocator);

substr :: inline (str: string, index: int, count: int = 0) -> string #must {
substr :: inline (str: string, index: int, count: int = 0) -> string {
if count == 0 count = str.count - index;

c: string = ---;
Expand Down
2 changes: 1 addition & 1 deletion websocket.jai
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ array_unordered_remove_by_value :: inline (array: *[..] $T, item: T, $stop_after
// Probably want to say something to debug memory trackers here.
// Need to make sure it doesn't cost anything in Release.
removed := 0;
for <<array if it == item {
for array.* if it == item {
removed += 1;
remove it;

Expand Down