-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removal label table global var (#14)
* Made variables private This change made the previosuly global `label_table` and the other `lable_table_size` variables static and added "getter" (Well, C do- es not have getters) functions that *gets* the values of the label table values and it's size. So, having the `label_table` and `label_table_size` variables hid- den away prevents mistakes by both the caller and internal functions that may accidentally: 1. redefine or attempt to clash with the variable names, and 2. unintentionally modify values of the label table's values. (So, basically, you can't be stupid enough to even attempt to modify a function's value) * Added declaration to headaer This change added in the function defined and added in commit nu- mber 19dbeef and chucked it into the `label.c`'s corrisponding header file. * Changed source of labels of `label_table` users Migrated the "users" (The places where the `label_table` and the corrisponding `label_table_size` gets called and used) to the more secure and safe `label_get_size()` and `label_get_table()` functions as added in commit number 19dbeef * Removed `inline` keyword Turns out the inline keyword requires an alternate implementation of the same function, therfore rendering this function undefined during link time. However when the compiler deems needed, the com- iler itself can *automatically inline* the as it deem fit during compile time without us explicitly specifying it in the function prototype. - I mean you learn something every day, huh?
- Loading branch information
1 parent
309ddd5
commit c23a5ce
Showing
5 changed files
with
22 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters