list · 2022-04-15 10:48
What are your opinions on my networking library epicnet?
I have recently added serialization and soykaf.
It is far from what I want it to be, but it is getting there.
It's written in C, using little libraries, and strives to be too complex
https://codeberg.org/fossy/epicnet
Delilah · 2022-04-15 15:07
There really should a "review my code" thread.
>>30787
I looked at your code briefly. The code overall looked good, but:
I think the make files should have a "clean" target that removes the binary file. Also, I think it would be better if you set the name of the binaries to something else than just "a.out". Consider also using -Werror=format-security and -Wextra compiler option.s
examples/snake/make.sh:
why you use c++? When you could use cc or just gcc/clang?
lib/constants.h:
I wouldn't do things like #define pOut printf (instead just write printf, etc.)
I think it makes the code harder to read.
client/main.c line 39 and server/main.c line 43:
there is a small typo, it should be: printf("int64_t: %lld\n", ...
Compiler also complains about %lld format specifier.
string · 2022-04-15 15:16
if you insist on a public domain-like license you should use 0bsd instead of cc0, google forbids cc0 but accepts 0bsd
https://opensource.google/documentation/reference/patching#forbidden
https://choosealicense.com/licenses/0bsd/
Cutter · 2022-04-15 17:08
>> 30792
> I looked at your code briefly. The code overall looked good, but:
Thanks, it is my first proper project in C.
> makefiles should have clean target to remove binary
Hmm why, for what is it used?
> Consider also using -Werror=format-security and -Wextra compiler options
I tried with it - everything stayed the same.
I am using OpenBSD and I have noticed that the compiler is a bit different as in it prints out more detail - so I am thinking these options are the default?
> examples/snake/make.sh:
why you use c++? When you could use cc or just gcc/clang?
It is a game some amazing programmer made. It has a separate damn README file.
> I wouldn't do things like
#define pOut printf
(instead just write printf, etc.)
I already changed this without reading what you wrote haha yeah I agree
> client/main.c line 39 and server/main.c line 43:
there is a small typo
Haha imagine your bug being printing out something.. so funny and embarrassing :d
They say not to copy-paste code for a reason.
> Compiler also complains about %lld format specifier.
Hmm? Mine does not 0.o
> 30794
First off - they didn't specify why they don't allow it.. I am assuming Intellectual Property.
Second off - I waive my IP rights additionally. I should have specified that the waiver in README files overwrite the thing in LICENSE file. But it should still be the same.
Third off - who gives a soykaf about Google? lol
Fourth off - 0bsd does seem decent, though. But I prefer the way I am doing it right now, since CC0 isn't just a software-specific license, you can license so many things such as your music, art with it.
Anyways - thank you very, very much for the reviews. And have a nice day.
Nanashi No Gombe · 2022-04-15 17:13
> examples/snake/make.sh:
why you use c++? When you could use cc or just gcc/clang?
Oh yes, I completely forgot.
While it is not my project, I did try compiling it with cc and it just works xD.
I am sorry if I came out as angry or something - you're right, thanks again.