diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib_os.c | 4 | ||||
| -rw-r--r-- | src/lj_carith.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lib_os.c b/src/lib_os.c index d6ca70f69..7821fc1fd 100644 --- a/src/lib_os.c +++ b/src/lib_os.c | |||
| @@ -240,8 +240,8 @@ LJLIB_CF(os_time) | |||
| 240 | ts.tm_min = getfield(L, "min", 0); | 240 | ts.tm_min = getfield(L, "min", 0); |
| 241 | ts.tm_hour = getfield(L, "hour", 12); | 241 | ts.tm_hour = getfield(L, "hour", 12); |
| 242 | ts.tm_mday = getfield(L, "day", -1); | 242 | ts.tm_mday = getfield(L, "day", -1); |
| 243 | ts.tm_mon = getfield(L, "month", -1) - 1; | 243 | ts.tm_mon = (int)((unsigned int)getfield(L, "month", -1) - 1u); |
| 244 | ts.tm_year = getfield(L, "year", -1) - 1900; | 244 | ts.tm_year = (int)((unsigned int)getfield(L, "year", -1) - 1900u); |
| 245 | ts.tm_isdst = getboolfield(L, "isdst"); | 245 | ts.tm_isdst = getboolfield(L, "isdst"); |
| 246 | t = mktime(&ts); | 246 | t = mktime(&ts); |
| 247 | } | 247 | } |
diff --git a/src/lj_carith.c b/src/lj_carith.c index 12c3ced28..cb408fb80 100644 --- a/src/lj_carith.c +++ b/src/lj_carith.c | |||
| @@ -135,7 +135,7 @@ static int carith_ptr(lua_State *L, CTState *cts, CDArith *ca, MMS mm) | |||
| 135 | return 0; | 135 | return 0; |
| 136 | lj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT_PSZ), ca->ct[1], | 136 | lj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT_PSZ), ca->ct[1], |
| 137 | (uint8_t *)&idx, ca->p[1], 0); | 137 | (uint8_t *)&idx, ca->p[1], 0); |
| 138 | if (mm == MM_sub) idx = -idx; | 138 | if (mm == MM_sub) idx = (ptrdiff_t)(~(uintptr_t)idx+1u); |
| 139 | } else if (mm == MM_add && ctype_isnum(ctp->info) && | 139 | } else if (mm == MM_add && ctype_isnum(ctp->info) && |
| 140 | (ctype_isptr(ca->ct[1]->info) || ctype_isrefarray(ca->ct[1]->info))) { | 140 | (ctype_isptr(ca->ct[1]->info) || ctype_isrefarray(ca->ct[1]->info))) { |
| 141 | /* Swap pointer and index. */ | 141 | /* Swap pointer and index. */ |
