Skip to content

Commit 3543bc4

Browse files
committed
Replace cJSON with lightweight mkjson library
Based on PR #575 feedback, this commit replaces the large cJSON library with the much smaller mkjson library for JSON output generation. Changes: - Replace cJSON (3,443 lines) with mkjson (357 lines) - ~10x reduction - Optimize JSON output to only emit true boolean flags - Use shorter field names (vid, pid, nports, ppps) - Fix code style issues (remove stdbool.h, change ret to rc) - Fix USB Full Speed detection for USB 2.0 devices - Add USB speed reference citation - Add missing newline at end of Makefile The JSON output format remains compatible while significantly reducing the library size as requested.
1 parent a2f3932 commit 3543bc4

File tree

6 files changed

+680
-3621
lines changed

6 files changed

+680
-3621
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ else
3737
endif
3838

3939
PROGRAM = uhubctl
40-
SOURCES = $(PROGRAM).c cJSON.c
40+
SOURCES = $(PROGRAM).c mkjson.c
4141
OBJECTS = $(SOURCES:.c=.o)
4242

4343
all: $(PROGRAM)
@@ -55,4 +55,4 @@ install:
5555
clean:
5656
$(RM) $(OBJECTS) $(PROGRAM).dSYM $(PROGRAM)
5757

58-
.PHONY: all install clean
58+
.PHONY: all install clean

0 commit comments

Comments
 (0)