diff options
author | Michal Soltys <soltys@ziu.info> | 2013-02-14 16:51:45 +0100 |
---|---|---|
committer | Michal Soltys <soltys@ziu.info> | 2013-02-14 16:52:59 +0100 |
commit | 1fa91c1fabf1a82196d76ee5f16c88cec5aa6b8e (patch) | |
tree | 1fa64e4369db175590561ea6bfa63ce6a4e6db01 /com32/chain/utility.h | |
parent | fd815ba71f52a94d2eae58238696cf32ffe4ac1a (diff) | |
download | syslinux-1fa91c1fabf1a82196d76ee5f16c88cec5aa6b8e.tar.gz |
com32/chain: comments, minor adjustment
- add some comments to clarify c{nul,add,max} modes
- use enums instead of defines
- remove unnecessary integer casts
- avoid casts and uninline guid_is0()
- minor handover comment/flow changes
- clean up some old comment-outs
- add -fno-strict-aliasing as it's not picked anymore by default for
elf.mk
Signed-off-by: Michal Soltys <soltys@ziu.info>
Diffstat (limited to 'com32/chain/utility.h')
-rw-r--r-- | com32/chain/utility.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/com32/chain/utility.h b/com32/chain/utility.h index 4e32dcdd..769c4d10 100644 --- a/com32/chain/utility.h +++ b/com32/chain/utility.h @@ -32,6 +32,7 @@ #define COM32_CHAIN_UTILITY_H #include <stdint.h> +#include <stdio.h> #include <syslinux/disk.h> #define bpbUNK 0 @@ -43,17 +44,21 @@ #define bpbVNT 6 #define bpbV70 7 -#define l2c_cnul 0 -#define l2c_cadd 1 -#define l2c_cmax 2 +/* see utility.c for details */ +enum {L2C_CNUL, L2C_CADD, L2C_CMAX}; -void error(const char *msg); -int guid_is0(const struct guid *guid); void wait_key(void); -void lba2chs(disk_chs *dst, const struct disk_info *di, uint64_t lba, uint32_t mode); +void lba2chs(disk_chs *dst, const struct disk_info *di, uint64_t lba, int mode); uint32_t get_file_lba(const char *filename); int drvoff_detect(int type, unsigned int *off); int bpb_detect(const uint8_t *bpb, const char *tag); +int guid_is0(const struct guid *guid); + +static inline +void error(const char *msg) +{ + fputs(msg, stderr); +} #endif |