diff --git a/arch/c5471/Make.defs b/arch/c5471/Make.defs index f75abdad61..359f4585ed 100644 --- a/arch/c5471/Make.defs +++ b/arch/c5471/Make.defs @@ -60,9 +60,6 @@ OBJDUMP = $(CROSSDEV)objdump CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe -LDFLAGS = $(ARCHSCRIPT) -EXTRA_LIBS = - OBJEXT = .o LIBEXT = .a diff --git a/arch/c5471/src/Makefile b/arch/c5471/src/Makefile index e2a4dc4ba6..3c1e50010c 100644 --- a/arch/c5471/src/Makefile +++ b/arch/c5471/src/Makefile @@ -56,6 +56,9 @@ COBJS = $(CSRCS:.c=.o) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) +LDFLAGS = $(ARCHSCRIPT) +EXTRA_LIBS = + LINKOBJS = LINKLIBS = LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS))) diff --git a/arch/sim/Make.defs b/arch/sim/Make.defs index da5b1ba480..3e4d0cf75e 100644 --- a/arch/sim/Make.defs +++ b/arch/sim/Make.defs @@ -59,9 +59,6 @@ OBJDUMP = $(CROSSDEV)objdump CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe -LDFLAGS = $(ARCHSCRIPT) -EXTRA_LIBS = -lc - OBJEXT = .o LIBEXT = .a diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile index cb3f96b73f..a3be44f35a 100644 --- a/arch/sim/src/Makefile +++ b/arch/sim/src/Makefile @@ -51,6 +51,9 @@ COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) +LDFLAGS = $(ARCHSCRIPT) +EXTRA_LIBS = -lc + LINKOBJS = LINKLIBS = LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS))) diff --git a/drivers/Makefile b/drivers/Makefile index dc07fcdc72..8d687a67c3 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -53,7 +53,7 @@ all: $(BIN) $(AOBJS): %$(OBJEXT): %.S $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ -$(cOBJS): %$(OBJEXT): %.c +$(COBJS): %$(OBJEXT): %.c $(CC) -c $(CFLAGS) $< -o $@ $(BIN): $(OBJS) diff --git a/fs/Makefile b/fs/Makefile index 647739e32b..b7d09a4e9f 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -54,7 +54,7 @@ all: $(BIN) $(AOBJS): %$(OBJEXT): %.S $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ -$(cOBJS): %$(OBJEXT): %.c +$(COBJS): %$(OBJEXT): %.c $(CC) -c $(CFLAGS) $< -o $@ $(BIN): $(OBJS) diff --git a/lib/lib_rint.c b/lib/lib_rint.c index 632c6632d9..a0f7dbd4fb 100644 --- a/lib/lib_rint.c +++ b/lib/lib_rint.c @@ -41,6 +41,7 @@ * Included Files ************************************************************/ +#include #include #include @@ -74,50 +75,61 @@ double_t rint(double_t x) { - double_t retValue; + double_t ret; -/* If the current rounding mode rounds toward negative - * infinity, rint() is identical to floor(). If the current - * rounding mode rounds toward positive infinity, rint() is - * identical to ceil(). */ -#if ((defined(FP_ROUND_POSITIVE)) && (FP_ROUNDING_POSITIVE != 0)) - retValue = ceil(x); + /* If the current rounding mode rounds toward negative + * infinity, rint() is identical to floor(). If the current + * rounding mode rounds toward positive infinity, rint() is + * identical to ceil(). + */ -#elif ((defined(FP_ROUND_NEGATIVE)) && (FP_ROUNDING_NEGATIVE != 0)) - retValue = floor(x); +#if defined(CONFIG_FP_ROUND_POSITIVE) && CONFIG_FP_ROUNDING_POSITIVE != 0 + + ret = ceil(x); + +#elif defined(CONFIG_FP_ROUND_NEGATIVE) && CONFIG_FP_ROUNDING_NEGATIVE != 0 + + ret = floor(x); #else /* In the default rounding mode (round to nearest), rint(x) is the * integer nearest x with the additional stipulation that if - * |rint(x)-x|=1/2, then rint(x) is even. */ + * |rint(x)-x|=1/2, then rint(x) is even. + */ - long dwInteger = (long)x; - double_t fRemainder = x - (double_t)dwInteger; + long dwinteger = (long)x; + double_t fremainder = x - (double_t)dwinteger; - if (x < 0.0) { + if (x < 0.0) + { + /* fremainder should be in range 0 .. -1 */ - /* fRemainder should be in range 0 .. -1 */ - if (fRemainder == -0.5) - dwInteger = ((dwInteger+1)&~1); - else if (fRemainder < -0.5) { - dwInteger--; + if (fremainder == -0.5) + { + dwinteger = ((dwinteger+1)&~1); + } + else if (fremainder < -0.5) + { + dwinteger--; + } + } + else + { + /* fremainder should be in range 0 .. 1 */ - } /* end if */ - } /* end if */ - else { + if (fremainder == 0.5) + { + dwinteger = ((dwinteger+1)&~1); + } + else if (fremainder > 0.5) + { + dwinteger++; + } + } - /* fRemainder should be in range 0 .. 1 */ - if (fRemainder == 0.5) - dwInteger = ((dwInteger+1)&~1); - else if (fRemainder > 0.5) { - dwInteger++; - - } /* end if */ - } /* end else */ - - retValue = (double_t)dwInteger; + ret = (double_t)dwinteger; #endif - return retValue; + return ret; }