Skip to content

Commit f90ef6d

Browse files
rickrick
rick
authored and
rick
committed
tighten up srcs
1 parent 9d88e80 commit f90ef6d

21 files changed

+64
-47
lines changed

.gitmodules

+12
Original file line numberDiff line numberDiff line change
@@ -1072,3 +1072,15 @@
10721072
[submodule "submodules/luaautoc"]
10731073
path = submodules/luaautoc
10741074
url = https://github.com/orangeduck/LuaAutoC
1075+
[submodule "submodules/tray"]
1076+
path = submodules/tray
1077+
url = https://github.com/zserge/tray
1078+
[submodule "submodules/c_tray"]
1079+
path = submodules/c_tray
1080+
url = https://github.com/binRick/c_tray
1081+
[submodule "submodules/qrcode"]
1082+
path = submodules/qrcode
1083+
url = https://github.com/gurushida/qrcode
1084+
[submodule "submodules/FEN2SVG"]
1085+
path = submodules/FEN2SVG
1086+
url = https://github.com/michael-i-f-george/FEN2SVG

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include submodules/c_deps/etc/includes.mk
33
local-setup: setup-binaries setup-golang setup-wg setup
44
MESON_DEFAULT_LIBRARY = static
55
MESON_DEFAULT_LIBRARY = shared
6+
WARN_LEVEL = 1
67
##############################################################
78
TIDIED_FILES = deps*/*.c deps*/*.h term*/*.c term*/*.h ctable*/*.c ctable*/*.h *table*/*.c *table*/*.h cgif-test/*.c *-test/*.c *-test/*.h chan-test/*.c chan-test/*.h \
89
introspect-test/*.c introspect-test/*.h \

ck-test/ck-test.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,12 @@ static struct ck_malloc alloc = {
2828
};
2929

3030
TEST t_ck_bitmap(){
31-
bool r;
3231
unsigned int length = 1024 * 1024 * 16;
3332
ck_bitmap_t *g_bits;
3433
unsigned int i;
3534
bool initial = false;
36-
unsigned int bytes, base;
37-
ck_bitmap_iterator_t iter;
35+
unsigned int bytes;
3836

39-
base = ck_bitmap_base(length);
4037
bytes = ck_bitmap_size(length);
4138
log_info("Configuration: %s", bytes_to_string(bytes));
4239

etc/template-subdir-module_c.j2

-24
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#ifndef {{SUBDIR_NAME|upper|replace('-','_')}}_C
44
#define {{SUBDIR_NAME|upper|replace('-','_')}}_C
55
////////////////////////////////////////////
6-
{%if SUBDIR_TEST_DEBUG_MEMORY_ENABLED%}#define DEBUG_MEMORY{%endif%}
7-
////////////////////////////////////////////
86
#include "{{SUBDIR_NAME}}/{{SUBDIR_NAME}}.h"
97
////////////////////////////////////////////
108
{%for i in INCLUDED_HEADERS.split(' ') -%}
@@ -30,26 +28,4 @@ void {{MODULE_NAME}}_deinit(module({{MODULE_NAME}}) *exports) {
3028
clib_module_deinit({{MODULE_NAME}});
3129
}
3230
////////////////////////////////////////////
33-
static inline int {{MODULE_NAME}}_GetPID(){
34-
return(require({{MODULE_NAME}})->pid);
35-
}
36-
37-
static inline void {{MODULE_NAME}}_info(char *message) {
38-
if (require({{MODULE_NAME}})->log_mode >= {{MODULE_NAME|upper}}_LOG_MODE_INFO) {
39-
fprintf(stdout, " info: %s\n", message);
40-
}
41-
}
42-
43-
static inline void {{MODULE_NAME}}_error(char *message) {
44-
if (require({{MODULE_NAME}})->log_mode >= {{MODULE_NAME|upper}}_LOG_MODE_ERROR) {
45-
fprintf(stderr, "error: %s\n", message);
46-
}
47-
}
48-
49-
static inline void {{MODULE_NAME}}_debug(char *message) {
50-
if (require({{MODULE_NAME}})->log_mode >= {{MODULE_NAME|upper}}_LOG_MODE_DEBUG) {
51-
fprintf(stderr, "debug: %s\n", message);
52-
}
53-
}
54-
////////////////////////////////////////////
5531
#endif

etc/template-subdir-module_h.j2

-8
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,7 @@ enum {{MODULE_NAME}}_log_mode_t {
2828

2929
module({{MODULE_NAME}}) {
3030
define({{MODULE_NAME}}, CLIB_MODULE);
31-
3231
enum {{MODULE_NAME}}_log_mode_t log_mode;
33-
int pid;
34-
35-
int (*GetPID)();
36-
void (*info)(char *);
37-
void (*debug)(char *);
38-
void (*error)(char *);
3932
};
4033

4134
int {{MODULE_NAME}}_init(module({{MODULE_NAME}}) *exports);
@@ -45,7 +38,6 @@ exports({{MODULE_NAME}}) {
4538
.log_mode = {{MODULE_NAME|upper}}_LOG_MODE_NONE,
4639
.init = {{MODULE_NAME}}_init,
4740
.deinit = {{MODULE_NAME}}_deinit,
48-
.pid = -1,
4941
};
5042

5143
#define {{MODULE_NAME}}_m module({{MODULE_NAME}})

etc/tidy.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ uncrustify-clean:
2222
@$(FIND) . -type f -name "*unc-backup*" |$(GREP) -v 'submodules|subprojects'|$(XARGS) -I % $(REALPATH) % | $(SORT) -u|$(XARGS) -P 10 -I % $(UNLINK) %
2323

2424
fix-dbg:
25+
@$(SED) 's|, %[[:space:]].*lu);|, %lu);|g' -i $(TIDIED_FILES)
2526
@$(SED) 's|, %[[:space:]].*u);|, %u);|g' -i $(TIDIED_FILES)
2627
@$(SED) 's|, %[[:space:]].*i);|, %i);|g' -i $(TIDIED_FILES)
2728
@$(SED) 's|, %[[:space:]].*h);|, %h);|g' -i $(TIDIED_FILES)
2829
@$(SED) 's|, %[[:space:]].*c);|, %c);|g' -i $(TIDIED_FILES)
2930
@$(SED) 's|, %[[:space:]].*s);|, %s);|g' -i $(TIDIED_FILES)
30-
@$(SED) 's|, %[[:space:]].*lu);|, %lu);|g' -i $(TIDIED_FILES)
3131
@$(SED) 's|, %[[:space:]].*ld);|, %ld);|g' -i $(TIDIED_FILES)
3232
@$(SED) 's|, %[[:space:]].*lld);|, %lld);|g' -i $(TIDIED_FILES)
3333
@$(SED) 's|, %[[:space:]].*d);|, %d);|g' -i $(TIDIED_FILES)

meson/deps/incbin/meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ incbin_dep = declare_dependency(
2424
incbin_headers = [
2525
'incbin.h',
2626
]
27+

meson/deps/jasper/meson.build

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
jasper_dep = dependency('jasper', method: 'pkg-config', required: true)
2-

meson/deps/probarlib/meson.build

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ probarlib_dirs = [
1111
inc,
1212
]
1313

14+
probarlib_c_args = [
15+
'-Wno-format-security',
16+
]
1417
probarlib_deps = [
1518

1619
]
@@ -20,6 +23,7 @@ probarlib_lib =library('probarlib',
2023
install: false,
2124
dependencies: probarlib_deps,
2225
include_directories: probarlib_dirs,
26+
c_args: probarlib_c_args,
2327
)
2428

2529
probarlib_dep = declare_dependency(

meson/deps/qoir/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ qoir_local_headers = [
55
'qoir/src/qoir.h',
66
]
77
qoir_srcs = [
8-
'../../../submodules/qoir/util/pixbufs_are_equal.c',
8+
#// '../../../submodules/qoir/util/pixbufs_are_equal.c',
99
'../../../submodules/qoir/util/load_file.c',
1010
]
1111

meson/deps/uptime/meson.build

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ uptime_deps = [
1414

1515
]
1616

17+
uptime_lib_static =static_library('uptime',
18+
uptime_srcs,
19+
install: false,
20+
dependencies: uptime_deps,
21+
include_directories: uptime_dirs,
22+
)
1723
uptime_lib =library('uptime',
1824
uptime_srcs,
1925
install: false,

meson/meson.build

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ subdir('args')
66
subdir('inc')
77
subdir('python')
88
####################################
9+
subdir('deps/uptime')
10+
subdir('deps/libqrencode')
911
subdir('deps/hash')
1012
subdir('deps/c_vector')
1113
subdir('deps/glib')
@@ -82,7 +84,6 @@ subdir('deps/subprocess')
8284
subdir('deps/dirname')
8385
subdir('deps/murmurhash.c')
8486
subdir('deps/libbeaufort')
85-
subdir('deps/uptime')
8687
subdir('deps/tty-copy')
8788
subdir('deps/bitset')
8889
subdir('deps/c-dt')
@@ -259,3 +260,9 @@ subdir('deps/lua')
259260
subdir('deps/luaautoc')
260261
subdir('deps/c_fzf')
261262
subdir('deps/c_bat')
263+
subdir('deps/tray')
264+
subdir('deps/c_tray')
265+
subdir('deps/ttyasc')
266+
subdir('deps/Simplified-QOI-Codec')
267+
subdir('deps/qrcode')
268+
subdir('deps/FEN2SVG')

meson/osx/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ add_global_link_arguments(osx_img_flags, language : ['c'])
5151

5252
osx_link_args = osx_ldflags
5353

54-
54+
add_project_arguments('-DTRAY_APPKIT=1', language : 'c')

scripts/new-meson-subdir.sh

+11
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ DEPENDENCIES="\
8686
ansi_codes_dep\
8787
c_vector_dep\
8888
c_fsio_dep\
89+
incbin_dep\
90+
tempdir_dep\
91+
which_dep\
92+
chan_dep\
93+
c_eventemitter_dep\
8994
c_stringfn_dep\
9095
c_string_buffer_dep\
9196
timestamp_dep\
@@ -97,10 +102,16 @@ INCLUDED_HEADERS="\
97102
ansi-codes/ansi-codes.h\
98103
c_vector/vector/vector.h\
99104
c_fsio/include/fsio.h\
105+
c_eventemitter/include/eventemitter.h\
100106
c_stringfn/include/stringfn.h\
101107
c_string_buffer/include/stringbuffer.h\
102108
timestamp/timestamp.h\
103109
log/log.h ms/ms.h\
110+
incbin/incbin.h\
111+
chan/src/chan.h chan/src/queue.h\
112+
which/src/which.h\
113+
tempdir.c/tempdir.h\
114+
module/def.h module/module.h module/require.h\
104115
bytes/bytes.h\
105116
"
106117
############################################################################################################

stumpless-test/stumpless-test.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TEST t_stumpless_test2(){
1919

2020
TEST t_stumpless_test1(){
2121
int count = 123;
22-
char username = "richard";
22+
char *username = "richard";
2323

2424
stumplog(LOG_INFO | LOG_USER, "My message #%d", count);
2525
/*
@@ -47,7 +47,7 @@ GREATEST_MAIN_DEFS();
4747

4848
int main(int argc, char **argv) {
4949
int count = 123;
50-
char username = "richard";
50+
char *username = "richard";
5151

5252
stumplog(LOG_INFO | LOG_USER, "My message #%d", count);
5353
GREATEST_MAIN_BEGIN();

submodules/FEN2SVG

Submodule FEN2SVG added at e07c500

submodules/c_tray

Submodule c_tray added at 7387d66

submodules/meson.build

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
##subdir(c_deps/meson/args)
2+
subdir('c_ansi/emojis')
23
subdir('c_ansi/ansi-utils')
3-
subdir('c_darwin/async')
4+
subdir('c_ansi/ts')
5+
subdir('c_ansi/str')
6+
subdir('c_ansi/exec')
7+
subdir('c_ansi/async')
8+
subdir('c_ansi/img')
9+
subdir('c_ansi/chess')
10+
#subdir('c_darwin/async')
411
##subdir(c_deps/meson/deps/cargs)
512
##subdir(c_deps/meson/sqlite3)
613
##subdir(c_deps/meson/deps/fort)
@@ -51,6 +58,8 @@ subdir('c_darwin/async')
5158
#subdir(c_deps/meson/deps/hsluv-c)
5259
##subdir(c_deps/meson/deps/vt100utils)
5360
#subdir(c_deps/submodules/c_ansi/string-utils)
61+
#subdir(c_ansi/async)
62+
#subdir(c_ansi/str)
5463
#subdir(c_deps/submodules/c_ansi/ansi-utils)
5564
#subdir(c_deps/submodules/c_ansi/ansi-rgb-utils)
5665
##subdir(c_deps/meson/deps/sqldbal)

submodules/qrcode

Submodule qrcode added at d023e6a

submodules/tray

Submodule tray added at 8dd1358

uptime-test/uptime-test.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
////////////////////////////////////////////
2-
31
////////////////////////////////////////////
42
#include "uptime-test/uptime-test.h"
53
////////////////////////////////////////////
@@ -13,7 +11,7 @@
1311

1412
////////////////////////////////////////////
1513
TEST t_uptime_test(){
16-
printf("Uptime: %lu\n", getUptime());
14+
printf("Uptime: %lld\n", getUptime());
1715
PASS();
1816
}
1917

0 commit comments

Comments
 (0)