mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
fixes, and removed a #pragma warning(disable ...) in MSVC .. thanks to the FILE wrapping interface.
This commit is contained in:
parent
d18656c2dc
commit
4224ac5ca0
2 changed files with 16 additions and 19 deletions
12
file.c
12
file.c
|
@ -131,12 +131,12 @@
|
|||
* These are implemented as just generic wrappers to keep consistency in
|
||||
* the API. Not as macros though
|
||||
*/
|
||||
void GMQCC_INLINE file_close(FILE *fp) {
|
||||
void file_close(FILE *fp) {
|
||||
/* Invokes file_exception on windows if fp is null */
|
||||
fclose (fp);
|
||||
}
|
||||
|
||||
size_t GMQCC_INLINE file_write (
|
||||
size_t file_write (
|
||||
const void *buffer,
|
||||
size_t size,
|
||||
size_t count,
|
||||
|
@ -146,22 +146,22 @@ size_t GMQCC_INLINE file_write (
|
|||
return fwrite(buffer, size, count, fp);
|
||||
}
|
||||
|
||||
int GMQCC_INLINE file_error(FILE *fp) {
|
||||
int file_error(FILE *fp) {
|
||||
/* Invokes file_exception on windows if fp is null */
|
||||
return ferror(fp);
|
||||
}
|
||||
|
||||
int GMQCC_INLINE file_getc(FILE *fp) {
|
||||
int file_getc(FILE *fp) {
|
||||
/* Invokes file_exception on windows if fp is null */
|
||||
return fgetc(fp);
|
||||
}
|
||||
|
||||
int GMQCC_INLINE file_puts(FILE *fp, const char *str) {
|
||||
int file_puts(FILE *fp, const char *str) {
|
||||
/* Invokes file_exception on windows if fp is null */
|
||||
return fputs(str, fp);
|
||||
}
|
||||
|
||||
int GMQCC_INLINE file_seek(FILE *fp, long int off, int whence) {
|
||||
int file_seek(FILE *fp, long int off, int whence) {
|
||||
/* Invokes file_exception on windows if fp is null */
|
||||
return fseek(fp, off, whence);
|
||||
}
|
||||
|
|
23
gmqcc.h
23
gmqcc.h
|
@ -37,7 +37,6 @@
|
|||
#ifdef _MSC_VER
|
||||
# pragma warning(disable : 4244 ) /* conversion from 'int' to 'float', possible loss of data */
|
||||
# pragma warning(disable : 4018 ) /* signed/unsigned mismatch */
|
||||
# pragma warning(disable : 4996 ) /* This function or variable may be unsafe */
|
||||
#endif
|
||||
|
||||
#define GMQCC_VERSION_MAJOR 0
|
||||
|
@ -379,20 +378,18 @@ void util_htseth(hash_table_t *ht, const char *key, size_t hash, void *
|
|||
/*===================================================================*/
|
||||
/*============================ file.c ===============================*/
|
||||
/*===================================================================*/
|
||||
void GMQCC_INLINE file_close (FILE *);
|
||||
GMQCC_INLINE void file_close (FILE *);
|
||||
GMQCC_INLINE int file_error (FILE *);
|
||||
GMQCC_INLINE int file_getc (FILE *);
|
||||
GMQCC_INLINE int file_printf (FILE *, const char *, ...);
|
||||
GMQCC_INLINE int file_puts (FILE *, const char *);
|
||||
GMQCC_INLINE int file_seek (FILE *, long int, int);
|
||||
|
||||
int GMQCC_INLINE file_error (FILE *);
|
||||
int GMQCC_INLINE file_getc (FILE *);
|
||||
int GMQCC_INLINE file_printf (FILE *, const char *, ...);
|
||||
int GMQCC_INLINE file_puts (FILE *, const char *);
|
||||
int GMQCC_INLINE file_seek (FILE *, long int, int);
|
||||
GMQCC_INLINE size_t file_read (void *, size_t, size_t, FILE *);
|
||||
GMQCC_INLINE size_t file_write (const void *, size_t, size_t, FILE *);
|
||||
|
||||
size_t GMQCC_INLINE file_read (void *, size_t, size_t, FILE *);
|
||||
size_t GMQCC_INLINE file_write (const void *, size_t, size_t, FILE *);
|
||||
|
||||
FILE* GMQCC_INLINE file_open (const char *, const char *);
|
||||
|
||||
int /*NO_INLINE*/ file_getline(char **, size_t *, FILE *);
|
||||
GMQCC_INLINE FILE *file_open (const char *, const char *);
|
||||
/*NOINLINE*/ int file_getline(char **, size_t *, FILE *);
|
||||
|
||||
|
||||
/*===================================================================*/
|
||||
|
|
Loading…
Reference in a new issue