mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-19 01:15:12 -04:00
[misc] add missing.h header
* Also clean up code
This commit is contained in:
parent
d3c9afa2fd
commit
c3f47ada06
23 changed files with 289 additions and 258 deletions
30
src/rufus.h
30
src/rufus.h
|
@ -469,25 +469,6 @@ static __inline BOOL UnlockDrive(HANDLE hDrive) {
|
|||
return DeviceIoControl(hDrive, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL, 0, &size, NULL);
|
||||
}
|
||||
|
||||
static __inline void *_reallocf(void *ptr, size_t size) {
|
||||
void *ret = realloc(ptr, size);
|
||||
if (!ret)
|
||||
free(ptr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static __inline uint16_t bswap_16(uint16_t x) {
|
||||
return (x >> 8) | (x << 8);
|
||||
}
|
||||
|
||||
static __inline uint32_t bswap_32(uint32_t x) {
|
||||
return (bswap_16(x & 0xffff) << 16) | (bswap_16(x >> 16));
|
||||
}
|
||||
|
||||
static __inline uint64_t bswap_64(uint64_t x) {
|
||||
return (((uint64_t) bswap_32(x & 0xffffffffull)) << 32) | (bswap_32(x >> 32));
|
||||
}
|
||||
|
||||
/* Hash tables */
|
||||
typedef struct htab_entry {
|
||||
uint32_t used;
|
||||
|
@ -580,17 +561,6 @@ static __inline HMODULE GetLibraryHandle(char* szLibraryName) {
|
|||
#define ERROR_CANT_ASSIGN_LETTER 0x120B
|
||||
#define ERROR_CANT_MOUNT_VOLUME 0x120C
|
||||
|
||||
/* More niceties */
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef PBS_MARQUEE
|
||||
#define PBS_MARQUEE 0x08
|
||||
#endif
|
||||
#ifndef PBM_SETMARQUEE
|
||||
#define PBM_SETMARQUEE (WM_USER+10)
|
||||
#endif
|
||||
|
||||
/* Why oh why does Microsoft have to make everybody suffer with their braindead use of Unicode? */
|
||||
#define _RT_ICON MAKEINTRESOURCEA(3)
|
||||
#define _RT_DIALOG MAKEINTRESOURCEA(5)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue