Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6f26346

Browse files
committed
fix -Wshift-negative-value
1 parent a0fdc8c commit 6f26346

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎core/potion.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ struct PNVtable;
210210
/// Integer: 31bit/63bit shifted off the last 1 bit
211211
/// or a PNDouble double.
212212
///\see PN_NUM (int to obj), PN_INT (obj to int), PN_IS_INT (is num obj?)
213-
#define PN_NUM(i) ((PN)((((long)(i))<<1) + PN_FINTEGER))
214-
#define PN_INT(x) ((long)((long)(x))>>1)
213+
#define PN_NUM(i) ((PN)((((unsigned long)(i))<<1) + PN_FINTEGER))
214+
#define PN_INT(x) ((long)((unsigned long)(x))>>1)
215215
#define PN_DBL(num) (PN_IS_INT(num) ? (double)PN_INT(num) : ((struct PNDouble *)num)->value)
216216
typedef _PN (*PN_F)(Potion *, PN, PN, ...);
217217
#define PN_PREC 16

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /