summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-12-10 15:33:56 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-12-10 15:33:56 +1300
commitec0237b1386c7c16d19bf33e486bf3be71b4fb15 (patch)
treea30c60eff3e3f49328b6c70a13495b07a88b9b73
parentSwitch spaces to tabs (diff)
downloadfuncptr-ec0237b1386c7c16d19bf33e486bf3be71b4fb15.tar.gz
funcptr-ec0237b1386c7c16d19bf33e486bf3be71b4fb15.zip
Remove some unneeded brackets
-rw-r--r--funcptrptr.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/funcptrptr.c b/funcptrptr.c
index 810764e..17864a0 100644
--- a/funcptrptr.c
+++ b/funcptrptr.c
@@ -22,23 +22,20 @@ int half(int i) {
void fpv_exec(int (**fpv)(int), int n) {
int i;
- for (i = 0; *(fpv + i) != NULL; i++) {
+ for (i = 0; *(fpv + i) != NULL; i++)
printf("%d\n", (*(fpv + i))(n));
- }
}
void fpvv_exec(int (***fpvv)(int), int n) {
int i;
- for (i = 0; *(fpvv + i) != NULL; i++) {
+ for (i = 0; *(fpvv + i) != NULL; i++)
fpv_exec(*(fpvv + i), n);
- }
}
void fpvvv_exec(int (****fpvvv)(int), int n) {
int i;
- for (i = 0; *(fpvvv + i) != NULL; i++) {
+ for (i = 0; *(fpvvv + i) != NULL; i++)
fpvv_exec(*(fpvvv + i), n);
- }
}
int main(int argc, char **argv) {
@@ -70,9 +67,8 @@ int main(int argc, char **argv) {
fpvvv[1][1][2] = half;
fpvvv[1][1][3] = NULL;
- for (argv++, argc--; argc; argv++, argc--) {
+ for (argv++, argc--; argc; argv++, argc--)
fpvvv_exec(fpvvv, atoi(*argv));
- }
exit(EXIT_SUCCESS);
}