From 310feb6536a57963d026a7f8a445aabbb1e6835a Mon Sep 17 00:00:00 2001 From: Wenyong Huang Date: Thu, 16 Sep 2021 16:36:42 +0800 Subject: [PATCH] Fix compilation warnings (#754) --- core/iwasm/aot/aot_intrinsic.h | 3 +-- core/shared/platform/common/math/math.c | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/iwasm/aot/aot_intrinsic.h b/core/iwasm/aot/aot_intrinsic.h index cc8cbcc9..84a8be83 100644 --- a/core/iwasm/aot/aot_intrinsic.h +++ b/core/iwasm/aot/aot_intrinsic.h @@ -6,12 +6,11 @@ #ifndef _AOT_INTRINSIC_H #define _AOT_INTRINSIC_H +#include "aot_runtime.h" #if WASM_ENABLE_WAMR_COMPILER != 0 #include "aot_llvm.h" #endif -#include "aot_runtime.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/core/shared/platform/common/math/math.c b/core/shared/platform/common/math/math.c index 53fcafed..6b4f25f2 100644 --- a/core/shared/platform/common/math/math.c +++ b/core/shared/platform/common/math/math.c @@ -534,7 +534,8 @@ static double freebsd_atan2(double y, double x) case 0: case 1: return y; /* atan(+-0,+anything)=+-0 */ case 2: return pi+tiny;/* atan(+0,-anything) = pi */ - case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ + case 3: + default: return -pi-tiny;/* atan(-0,-anything) =-pi */ } } /* when x = 0 */ @@ -547,14 +548,16 @@ static double freebsd_atan2(double y, double x) case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */ case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */ case 2: return 3.0*pi_o_4+tiny;/*atan(+INF,-INF)*/ - case 3: return -3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/ + case 3: + default: return -3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/ } } else { switch(m) { case 0: return zero ; /* atan(+...,+INF) */ case 1: return -zero ; /* atan(-...,+INF) */ case 2: return pi+tiny ; /* atan(+...,-INF) */ - case 3: return -pi-tiny ; /* atan(-...,-INF) */ + case 3: + default: return -pi-tiny ; /* atan(-...,-INF) */ } } }