Skip to content

Commit 5b095f0

Browse files
rickrick
rick
authored and
rick
committed
tighten up qoir
1 parent 700f558 commit 5b095f0

File tree

175 files changed

+2422
-6294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+2422
-6294
lines changed

.gitmodules

+42
Original file line numberDiff line numberDiff line change
@@ -1030,3 +1030,45 @@
10301030
[submodule "submodules/optparse99-master"]
10311031
path = submodules/optparse99-master
10321032
url = https://github.com/hippie68/optparse99
1033+
[submodule "submodules/p99"]
1034+
path = submodules/p99
1035+
url = https://gitlab.inria.fr/gustedt/p99
1036+
[submodule "submodules/CException"]
1037+
path = submodules/CException
1038+
url = https://github.com/ThrowTheSwitch/CException
1039+
[submodule "submodules/submodules/c_exception"]
1040+
path = submodules/submodules/c_exception
1041+
url = https://github.com/ThrowTheSwitch/CException
1042+
[submodule "submodules/c_exception"]
1043+
path = submodules/c_exception
1044+
url = https://github.com/ThrowTheSwitch/CException
1045+
[submodule "submodules/stumpless"]
1046+
path = submodules/stumpless
1047+
url = https://github.com/goatshriek/stumpless
1048+
[submodule "base64_simd"]
1049+
path = base64_simd
1050+
url = https://github.com/aklomp/base64
1051+
[submodule "submodules/base64_simd"]
1052+
path = submodules/base64_simd
1053+
url = https://github.com/aklomp/base64
1054+
[submodule "submodules/c_ringbuf"]
1055+
path = submodules/c_ringbuf
1056+
url = https://github.com/dhess/c-ringbuf
1057+
[submodule "submodules/SDL_QOI"]
1058+
path = submodules/SDL_QOI
1059+
url = https://github.com/superzazu/SDL_QOI
1060+
[submodule "submodules/qoir"]
1061+
path = submodules/qoir
1062+
url = https://github.com/nigeltao/qoir
1063+
[submodule "submodules/roscha"]
1064+
path = submodules/roscha
1065+
url = https://github.com/binRick/c_roscha
1066+
[submodule "submodules/c"]
1067+
path = submodules/c
1068+
url = https://github.com/concurrencykit/ck
1069+
[submodule "submodules/ck"]
1070+
path = submodules/ck
1071+
url = https://github.com/concurrencykit/ck
1072+
[submodule "submodules/luaautoc"]
1073+
path = submodules/luaautoc
1074+
url = https://github.com/orangeduck/LuaAutoC

base64_simd

Submodule base64_simd added at fc980a1

bestline-test/bestline-test.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ TEST t_bestline_test(){
111111
fputs("'\n", stdout);
112112
bestlineHistoryAdd(line); /* Add to the history. */
113113
bestlineHistorySave(BESTLINE_HISTORY_FILE); /* Save the history on disk. */
114-
} else if (!strncmp(line, "/mask", 5)) {
114+
} else if (!strncmp(line, "/mask", 5))
115115
bestlineMaskModeEnable();
116-
} else if (!strncmp(line, "/unmask", 7)) {
116+
else if (!strncmp(line, "/unmask", 7))
117117
bestlineMaskModeDisable();
118-
} else if (line[0] == '/') {
118+
else if (line[0] == '/') {
119119
fputs("Unreconized command: ", stdout);
120120
fputs(line, stdout);
121121
fputs("\n", stdout);
@@ -126,9 +126,8 @@ TEST t_bestline_test(){
126126
}
127127

128128
SUITE(s_bestline_test) {
129-
if (isatty(STDOUT_FILENO)) {
129+
if (isatty(STDOUT_FILENO))
130130
RUN_TEST(t_bestline_test);
131-
}
132131
}
133132

134133
GREATEST_MAIN_DEFS();

blocks-test/blocks-test.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,8 @@ void __blocks_test__setup_executable_path(const char **argv){
292292
realpath(argv[0], EXECUTABLE_PATH);
293293
EXECUTABLE = basename(EXECUTABLE_PATH);
294294
EXECUTABLE_PATH_DIRNAME = dirname(EXECUTABLE_PATH);
295-
if (DEBUG_MODE_ENABLED) {
295+
if (DEBUG_MODE_ENABLED)
296296
fprintf(stderr, "blocks-test Initialized @ %s/%s\n", EXECUTABLE_PATH_DIRNAME, EXECUTABLE_PATH);
297-
}
298297
}
299298
//////////////////////////////////////////////////////////////////////////////////////////////////////
300299
void __attribute__((constructor)) __constructor__blocks_test(){

c-go-interface/c-adder/adder.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
#include <stdio.h>
21
#include "libadder.h"
2+
#include <stdio.h>
33

44
void go_string(void);
55

6-
76
int main() {
87
printf("C says: about to call Go...\n");
98
int total = GoAdder(1, 7);
109
printf("C says: Go calculated our total as %i\n", total);
11-
return 0;
10+
return(0);
1211
}
13-
14-

c-go-interface/c-call-libadder/main.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
#include <stdio.h>
21
#include "c-libadder/c-libadder.h"
2+
#include <stdio.h>
33

44
void go_string(void);
55

6-
76
int main() {
87
printf(">c-call-libadder says: about to call C...\n");
98
int total = adder(23, 115);
109
printf("C says: C calculated our total as %i\n", total);
11-
return 0;
10+
return(0);
1211
}
13-
14-

c-go-interface/c-hello/hello.c

+37-41
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,52 @@
1-
#include <stdio.h>
21
#include "libhello.h"
2+
#include <stdio.h>
33

44
void go_string(void);
55

6-
76
int main() {
87
go_string();
9-
return 0;
8+
return(0);
109
}
1110

1211
// Callback function to be called from Go
1312
void CallbackInC(char *go_str) {
14-
printf("CallbackInC(): %s\n", go_str);
15-
GoFreeString(go_str); // Release the Go string
13+
printf("CallbackInC(): %s\n", go_str);
14+
GoFreeString(go_str); // Release the Go string
1615
}
1716

18-
19-
2017
void go_string(void){
21-
22-
{
23-
char *go_str = GoStringFromGo();
24-
printf("GoStringFromGo(): %s\n", go_str);
25-
GoFreeString(go_str); // Release the Go string
18+
{
19+
char *go_str = GoStringFromGo();
20+
printf("GoStringFromGo(): %s\n", go_str);
21+
GoFreeString(go_str); // Release the Go string
22+
}
23+
{
24+
GoStringToGo("Calling from C");
25+
}
26+
{
27+
Demo_Array *go_array = GoArrayFromGo();
28+
printf("GoArrayFromGo():");
29+
int i;
30+
for (i = 0; i < go_array->len; i++) {
31+
printf(" %d", ((int *)(go_array->data))[i]);
2632
}
27-
{
28-
GoStringToGo("Calling from C");
29-
}
30-
{
31-
Demo_Array *go_array = GoArrayFromGo();
32-
printf("GoArrayFromGo():");
33-
int i;
34-
for(i=0; i < go_array->len; i++) {
35-
printf(" %d", ( (int *)(go_array->data) )[i]);
36-
}
37-
printf("\n");
38-
GoFreeArray(go_array); // Release the Demo_Array
39-
}
40-
41-
// Pass array to a Go library function
42-
{
43-
int c_array[] = { 4, 5, 6 };
44-
// Create a Demo_Array wrapper for the native C array
45-
Demo_Array go_array = { c_array, sizeof(c_array)/sizeof(c_array[0]) };
46-
}
47-
{
48-
GoFunctionToGo(&CallbackInC);
49-
}
50-
51-
// Receive a Go callback function and call it from here
52-
{
53-
void (*go_ptr)() = GoFunctionFromGo();
54-
(go_ptr)("Calling from C");
55-
}
33+
printf("\n");
34+
GoFreeArray(go_array); // Release the Demo_Array
35+
}
36+
37+
// Pass array to a Go library function
38+
{
39+
int c_array[] = { 4, 5, 6 };
40+
// Create a Demo_Array wrapper for the native C array
41+
Demo_Array go_array = { c_array, sizeof(c_array) / sizeof(c_array[0]) };
42+
}
43+
{
44+
GoFunctionToGo(&CallbackInC);
45+
}
46+
47+
// Receive a Go callback function and call it from here
48+
{
49+
void (*go_ptr)() = GoFunctionFromGo();
50+
(go_ptr)("Calling from C");
51+
}
5652
}
+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include <stdio.h>
21
#include "c-libadder.h"
32
#include "libadder.h"
3+
#include <stdio.h>
44

55
void go_string(void);
66

@@ -10,5 +10,3 @@ int adder(int a, int b) {
1010
printf(">libadder C says: Go calculated our total as %i\n", total);
1111
return(total);
1212
}
13-
14-

c-go-interface/c-restic/c-restic.c

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
#include <stdio.h>
21
#include "go-restic.h"
2+
#include <stdio.h>
33

44
void go_string(void);
55

6-
76
int main() {
87
printf("C> GoRestic()\n");
9-
return 0;
8+
return(0);
109
}
11-
12-
13-
14-

c-go-interface/c-ui/ui.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
#include <stdio.h>
21
#include "c-ui/ui.h"
32
#include "go-ui/libui.h"
3+
#include <stdio.h>
44

55
int main() {
66
printf("C says: about to call Go...\n");
77
UiMain();
8-
return 0;
8+
return(0);
99
}
10-
11-

chan-test/chan-test.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,8 @@ void init_workers(size_t WORKERS_QTY){
101101
}
102102

103103
TEST t_free_workers(){
104-
if (workers) {
104+
if (workers)
105105
free(workers);
106-
}
107106
workers = NULL;
108107

109108
ASSERT_EQ(workers, NULL);
@@ -172,14 +171,12 @@ TEST t_chan_jobs_worker(void *buffer_qty,
172171
sent_dur
173172
);
174173

175-
for (size_t i = 0; i < WORKERS_QTY; i++) {
174+
for (size_t i = 0; i < WORKERS_QTY; i++)
176175
chan_recv(DONE_CHANNEL, NULL);
177-
}
178176

179177
I("done signals received.....waiting on threads to exit....");
180-
for (size_t i = 0; i < WORKERS_QTY; i++) {
178+
for (size_t i = 0; i < WORKERS_QTY; i++)
181179
pthread_join(&worker_threads[i], NULL);
182-
}
183180

184181
I("threads exited..disposing of channels......");
185182
chan_dispose(JOBS_CHANNEL);

0 commit comments

Comments
 (0)