mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 16:26:59 +00:00
all files: use restrict key word for all pointer arguments
Limit the effects of pointer aliasing and aiding caching optimizations. http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
235825b084
commit
6b47d9ffaf
6 changed files with 33 additions and 32 deletions
|
|
@ -198,7 +198,7 @@ int parse_leases(void)
|
|||
* first field is 1 and not 0 like C programs should have. Question of
|
||||
* semantics, send mail to author if this annoys. All performance boosts for
|
||||
* this function are well come. */
|
||||
int nth_field(int n, char *dest, const char *src)
|
||||
int nth_field(int n, char *restrict dest, const char *restrict src)
|
||||
{
|
||||
int i, j = 0, wordn = 0, len;
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ int nth_field(int n, char *dest, const char *src)
|
|||
}
|
||||
|
||||
/* dhcpd.conf interesting words */
|
||||
int is_interesting_config_clause(char *s)
|
||||
int is_interesting_config_clause(char *restrict s)
|
||||
{
|
||||
if (strstr(s, "range")) {
|
||||
return 3;
|
||||
|
|
@ -239,8 +239,8 @@ int is_interesting_config_clause(char *s)
|
|||
}
|
||||
|
||||
/* FIXME: This spagetti monster function need to be rewrote at least ones. */
|
||||
void parse_config(int is_include, char *config_file,
|
||||
struct shared_network_t *shared_p)
|
||||
void parse_config(int is_include, const char *restrict config_file,
|
||||
struct shared_network_t *restrict shared_p)
|
||||
{
|
||||
FILE *dhcpd_config;
|
||||
int newclause = true, argument = false, comment =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue