-
Notifications
You must be signed in to change notification settings - Fork 4
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
Code polishing #8
Comments
Besides, let's not use tabs, but only 4 spaces. |
I would propose C++ code style from google https://google.github.io/styleguide/cppguide.html |
I think we could choose kernel code style, we are not developing a CPP program. |
About code formatting, if we follow kernel's code style, kernel provides a "script" could help us to tidy all code. |
About some function is 'static' or not. or something else.
Issue 1, yes we need clear them to declare or define. and rearrange them, I agree. Issue 2, this is a tricky issue, it relative to "linker and loader" and "ld script". sometimes, also be impacted by memory layout and stack segment status. "static data" will put into an "initial data segment", no static might somewhere else. I did this for the sake of convenience. Over time, we began to understand these technical points step by step, and we can optimize them. |
The kernel code style is perfect. |
I staticized all possible methods in the start.c file in my fork and moreover I made all possible variables local (i.e. allocated on stack instead of the heap) and all works as fine. |
so cool, so would you mind share your code via a PR? |
We have an agreement at using kernel code style. crazyss#8 So I porting a script at script/Lindent from kernel source tree. and apply it on all *.[ch] files, Assembly file doesn't do.
We have an agreement at using kernel code style. crazyss#8 So I porting a script at script/Lindent from kernel source tree. and apply it on all *.[ch] files, Assembly file doesn't do.
I have created a PR #13, please have a look. |
I think the code needs to chose some well used coding convention (or make up our own) and format the code according to it. What is also worthy to do is to make the functions static that are static. There are many functions declared in the common.h file although they are not common, e.g. init_keyboard(), enable_mouse(), etc.
The text was updated successfully, but these errors were encountered: