Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi file #7

Closed
wants to merge 6 commits into from
Closed

Conversation

sundaran1122
Copy link
Contributor

moved global variables to globals.c
and moved #defines to helpers.h

@sundaran1122
Copy link
Contributor Author

we still have a lot of work to do

@leo-arch
Copy link
Owner

leo-arch commented May 7, 2021

Last night I got the whole thing working: the single source file is now split into 25 (or more) c files. I'm using a central header file (includes, defines, and globals, as extern) and files organized by feature/function. I hope to finish the work today to push it to the test branch.

@sundaran1122
Copy link
Contributor Author

this will make maintaining it a lot easier

@leo-arch
Copy link
Owner

leo-arch commented May 7, 2021

The only thing I observed is that, after splitting the source file, it results in a bigger binary size: 460K before splitting, 650 or so after, and there's no new code at all. It isn't significant, but...

@sundaran1122
Copy link
Contributor Author

sundaran1122 commented May 7, 2021

its prob due to all the linking

@leo-arch
Copy link
Owner

leo-arch commented May 7, 2021

Ok. The first version is ready: the code is now split into 30 files, including headers (starting at main.c). Take a look at it (testing branch) and tell me what you think. I'm sure much could be improved, but is a good way to start (it compiles ok and works).

@sundaran1122
Copy link
Contributor Author

pretty nice already!

@sundaran1122 sundaran1122 deleted the multi-file branch May 8, 2021 06:09
@sundaran1122
Copy link
Contributor Author

there is still some stuff to do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants