aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author浅倉麗子2020-08-13 01:03:37 -0400
committer浅倉麗子2020-08-13 01:03:37 -0400
commitc4b693bb220875cf9e14e20d7cd3404bab00dbb1 (patch)
tree6484f7a7cf2c7557b88c9d27c2ce94dbebda936b
parentMove common macros into separate header (diff)
downloadsharpscale-c4b693bb220875cf9e14e20d7cd3404bab00dbb1.tar.gz
Use macro for __attribute__ ((unused))
-rw-r--r--config-app/main.c3
-rw-r--r--include/common.h2
-rw-r--r--main.c4
-rw-r--r--scaling-test/main.c6
4 files changed, 9 insertions, 6 deletions
diff --git a/config-app/main.c b/config-app/main.c
index 771f7a5..bcb4506 100644
--- a/config-app/main.c
+++ b/config-app/main.c
@@ -26,6 +26,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <psp2dbg.h>
#include <vita2d_sys.h>
+#include "common.h"
#include "sharpscale.h"
void *memset(void *dest, int ch, size_t count) {
@@ -48,7 +49,7 @@ static int text_yellow(int a) {
return a ? TEXT_YELLOW : TEXT_BLACK;
}
-void _start(int args, void *argp) { (void)args; (void)argp;
+void _start(UNUSED int args, UNUSED void *argp) {
SCE_DBG_FILELOG_INIT("ux0:/sharpscale-config.log");
// Show application memory budget information
diff --git a/include/common.h b/include/common.h
index 121222e..0c59cde 100644
--- a/include/common.h
+++ b/include/common.h
@@ -26,4 +26,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1))
+#define UNUSED __attribute__ ((unused))
+
#endif
diff --git a/main.c b/main.c
index dfdf23b..6a69bd0 100644
--- a/main.c
+++ b/main.c
@@ -312,7 +312,7 @@ static void cleanup(void) {
SCE_DBG_FILELOG_TERM();
}
-int module_start(SceSize args, const void *argp) { (void)args; (void)argp;
+int module_start(UNUSED SceSize args, UNUSED const void *argp) {
int ret;
startup();
@@ -350,7 +350,7 @@ fail:
return SCE_KERNEL_START_FAILED;
}
-int module_stop(SceSize args, const void *argp) { (void)args; (void)argp;
+int module_stop(UNUSED SceSize args, UNUSED const void *argp) {
cleanup();
return SCE_KERNEL_STOP_SUCCESS;
}
diff --git a/scaling-test/main.c b/scaling-test/main.c
index 1976877..a5bbaa5 100644
--- a/scaling-test/main.c
+++ b/scaling-test/main.c
@@ -58,7 +58,7 @@ static res_t fb_res[FB_RES_LEN] = {
};
static void render(int *fb_base, int width, int pitch, int height) {
- SceUInt32 start_time = sceKernelGetProcessTimeLow();
+ UNUSED SceUInt32 start_time = sceKernelGetProcessTimeLow();
int32x2x4_t vert_line = vld4_s32((int32_t[]){WHITE, BLACK, WHITE, BLACK, WHITE, BLACK, WHITE, BLACK});
@@ -104,7 +104,7 @@ static void render(int *fb_base, int width, int pitch, int height) {
SCE_DBG_LOG_DEBUG("Rendered in %d ms\n", (sceKernelGetProcessTimeLow() - start_time) / 1000);
}
-void _start(int args, void *argp) { (void)args; (void)argp;
+void _start(UNUSED int args, UNUSED void *argp) {
SCE_DBG_FILELOG_INIT("ux0:/sharpscale-scaling-test.log");
fnblit_set_font(_binary_unifont_sfn_start);
@@ -146,7 +146,7 @@ void _start(int args, void *argp) { (void)args; (void)argp;
} else {
SCE_DBG_LOG_ERROR("Set resolution %dx%d failed error %08X\n", width, height, ret);
- SceUInt32 start_time = sceKernelGetProcessTimeLow();
+ UNUSED SceUInt32 start_time = sceKernelGetProcessTimeLow();
sceDmacMemset(fb_base, 0xFF, 960 * 544 * 4);
SCE_DBG_LOG_DEBUG("Cleared in %d ms\n", (sceKernelGetProcessTimeLow() - start_time) / 1000);