Skip to content

Commit

Permalink
Fix "left shift of negative value" warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cfr34k committed Mar 2, 2019
1 parent e3b2e82 commit 4599cdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fxp.h
Expand Up @@ -13,7 +13,7 @@
/*
* FXP conversion macros
*/
#define FXP_FROM_INT(x) ((fxp_t)(x) << POINTPOS)
#define FXP_FROM_INT(x) ((x >= 0) ? ((fxp_t)(x) << POINTPOS) : (-((fxp_t)(-x) << POINTPOS)))
#define FXP_TO_INT(x) ((int32_t)((x) >> POINTPOS))

/*
Expand Down

0 comments on commit 4599cdc

Please sign in to comment.