commit bc350e7182f7f18fe70de32a2f7e05a73e371ce5
parent 3f0ef4538e7d1617b39e09a4cbd78312a9fcdc2e
Author: vaplv <vaplv@free.fr>
Date: Wed, 22 Nov 2017 10:18:15 +0100
Rm the 'deprecated' warning in the deprecated image_ppm_write function
Diffstat:
| M | src/image.c | | | 72 | +++++++++++++++++++++++++++++++++++++++++++----------------------------- |
| M | src/rsys.h | | | 8 | ++++---- |
2 files changed, 47 insertions(+), 33 deletions(-)
diff --git a/src/image.c b/src/image.c
@@ -379,35 +379,11 @@ error:
goto exit;
}
-res_T
-image_ppm_write
- (const char* path,
- const int width,
- const int height,
- const int Bpp,
- const unsigned char* buffer)
-{
- FILE* fp = NULL;
- res_T res = RES_OK;
-
- fp = fopen(path, "w");
- if(NULL == fp) {
- res = RES_IO_ERR;
- goto error;
- }
-
- res = image_ppm_write_stream(fp, width, height, Bpp, buffer);
- if(res != RES_OK) goto error;
-
-exit:
- if(fp) fclose(fp);
- return res;
-error:
- goto exit;
-}
-
-res_T
-image_ppm_write_stream
+/*******************************************************************************
+ * Deprecated functions
+ ******************************************************************************/
+static res_T
+deprecated_image_ppm_write_stream
(FILE* fp,
const int width,
const int height,
@@ -454,3 +430,41 @@ error:
goto exit;
}
+res_T
+image_ppm_write
+ (const char* path,
+ const int width,
+ const int height,
+ const int Bpp,
+ const unsigned char* buffer)
+{
+ FILE* fp = NULL;
+ res_T res = RES_OK;
+
+ fp = fopen(path, "w");
+ if(NULL == fp) {
+ res = RES_IO_ERR;
+ goto error;
+ }
+
+ res = deprecated_image_ppm_write_stream(fp, width, height, Bpp, buffer);
+ if(res != RES_OK) goto error;
+
+exit:
+ if(fp) fclose(fp);
+ return res;
+error:
+ goto exit;
+}
+
+res_T
+image_ppm_write_stream
+ (FILE* fp,
+ const int width,
+ const int height,
+ const int Bpp,
+ const unsigned char* buffer)
+{
+ return deprecated_image_ppm_write_stream(fp, width, height, Bpp, buffer);
+}
+
diff --git a/src/rsys.h b/src/rsys.h
@@ -233,10 +233,10 @@
FATAL("error:" STR(__FILE__) ":" STR(__LINE__)"\n"); \
} (void)0
-static INLINE DEPRECATED void deprecated_CHECK(void) { (void)0; }
-static INLINE DEPRECATED void deprecated_NCHECK(void) { (void)0; }
-#define CHECK(A, B) { deprecated_CHECK(); CHK((A) == (B)); } (void)0
-#define NCHECK(A, B) { deprecated_NCHECK(); CHK((A) != (B)); } (void)0
+static INLINE DEPRECATED void macro_CHECK(void) { (void)0; }
+static INLINE DEPRECATED void macro_NCHECK(void) { (void)0; }
+#define CHECK(A, B) { macro_CHECK(); CHK((A) == (B)); } (void)0
+#define NCHECK(A, B) { macro_NCHECK(); CHK((A) != (B)); } (void)0
/*******************************************************************************
* Branch prediction information