From 40db88d4ebb955d2b267322f14bf30ea6243d3f2 Mon Sep 17 00:00:00 2001 From: _ <_> Date: Tue, 17 Apr 2018 19:42:28 -0700 Subject: [PATCH] Minor re-ordering --- include/devil1pld.h | 13 +++++++------ src/devil1pld.c | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/devil1pld.h b/include/devil1pld.h index f79e496..5de204f 100644 --- a/include/devil1pld.h +++ b/include/devil1pld.h @@ -13,6 +13,13 @@ struct PldHeader { #pragma pack(pop) +typedef struct { + bool (* const getheader) (struct PldHeader*, const char*); + int (* const sizeofsector)(struct PldHeader*, unsigned int, unsigned int); + void (* const printheader) (struct PldHeader*); +} namespace_struct; +extern namespace_struct const DEVIL1PLD; + // input: pointer to a struct, contents of the .pld file. // * = pass by reference of a struct PldHeader static bool getpldh(struct PldHeader*, const char*); @@ -25,11 +32,5 @@ static int sizeofpldstruct(struct PldHeader*, unsigned int, unsigned int); // * = pass by reference of a struct PldHeader static void printpldh(struct PldHeader*); -typedef struct { - bool (* const getheader) (struct PldHeader*, const char*); - int (* const sizeofsector)(struct PldHeader*, unsigned int, unsigned int); - void (* const printheader) (struct PldHeader*); -} namespace_struct; -extern namespace_struct const DEVIL1PLD; #endif diff --git a/src/devil1pld.c b/src/devil1pld.c index 148e323..d29aafe 100644 --- a/src/devil1pld.c +++ b/src/devil1pld.c @@ -1,6 +1,8 @@ #include "devil1pld.h" #include +namespace_struct const DEVIL1PLD = {getpldh, sizeofpldstruct, printpldh}; + static bool getpldh(struct PldHeader *ph, const char *filedata) { bool good = false; if (ph != NULL && filedata != NULL) { @@ -40,5 +42,3 @@ static void printpldh(struct PldHeader *ph) { printf("offset %i = %x\n", i, ph -> offsets[i]); } } - -namespace_struct const DEVIL1PLD = {getpldh, sizeofpldstruct, printpldh};