diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-01-26 14:29:09 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-01-26 14:29:09 +1300 |
commit | 7df4e8635e21adb9e3e08444e07d776dc958c33d (patch) | |
tree | 6ca968bf26d49be555a054eb37765ec4c76c2e75 | |
parent | Re-use passed pointers for cheap iteration (diff) | |
download | funcptr-7df4e8635e21adb9e3e08444e07d776dc958c33d.tar.gz funcptr-7df4e8635e21adb9e3e08444e07d776dc958c33d.zip |
Add length to arrays
To satisfy -Wall, -Wpedantic
-rw-r--r-- | funcptr.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -4,7 +4,7 @@ int doub(int); int trip(int); int half(int); -static int (*fpv[])(int); +static int (*fpv[4])(int); void fpv_exec(int (**)(int), int); int doub(int i) { @@ -19,7 +19,7 @@ int half(int i) { return i / 2; } -static int (*fpv[])(int) = {doub, trip, half, NULL}; +static int (*fpv[4])(int) = {doub, trip, half, NULL}; void fpv_exec(int (**fpv)(int), int n) { while (*fpv) |