Skip to content

Commit 56e285a

Browse files
dgram0jreback
authored andcommitted
CLN/BUILD: Fix warnings on build
closes #12471
1 parent c81d03b commit 56e285a

File tree

11 files changed

+13
-19
lines changed

11 files changed

+13
-19
lines changed

doc/source/whatsnew/v0.18.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,7 @@ Bug Fixes
10491049
- Bug in ``pd.read_stata`` with version <= 108 files (:issue:`12232`)
10501050
- Bug in ``Series.resample`` using a frequency of ``Nano`` when the index is a ``DatetimeIndex`` and contains non-zero nanosecond parts (:issue:`12037`)
10511051
- Bug in resampling with ``.nunique`` and a sparse index (:issue:`12352`)
1052+
- Removed some compiler warnings (:issue:`12471`)
10521053

10531054
- Bug in ``NaT`` subtraction from ``Timestamp`` or ``DatetimeIndex`` with timezones (:issue:`11718`)
10541055
- Bug in subtraction of ``Series`` of a single tz-aware ``Timestamp`` (:issue:`12290`)

doc/source/whatsnew/v0.18.1.txt

+1
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ Performance Improvements
4343

4444
Bug Fixes
4545
~~~~~~~~~
46+

pandas/src/datetime/np_datetime_strings.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ parse_iso_8601_datetime(char *str, int len,
400400
* an error code will be retuned because the date is ambigous
401401
*/
402402
int has_sep = 0;
403-
char sep;
403+
char sep = '\0';
404404
char valid_sep[] = {'-', '.', '/', '\\', ' '};
405405
int valid_sep_len = 5;
406406

pandas/src/klib/khash.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ typedef khint_t khiter_t;
152152
#define __ac_set_isempty_false(flag, i) (flag[i>>5]&=~(1ul<<(i&0x1fU)))
153153
#define __ac_set_isempty_true(flag, i) (flag[i>>5]|=(1ul<<(i&0x1fU)))
154154
#define __ac_set_isboth_false(flag, i) __ac_set_isempty_false(flag, i)
155-
#define __ac_set_isdel_true(flag, i) (0)
155+
#define __ac_set_isdel_true(flag, i) ((void)0)
156156

157157
#ifdef KHASH_LINEAR
158158
#define __ac_inc(k, m) 1

pandas/src/msgpack/unpack.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,9 @@ static inline int unpack_callback_ext(unpack_user* u, const char* base, const ch
265265
}
266266
// length also includes the typecode, so the actual data is length-1
267267
#if PY_MAJOR_VERSION == 2
268-
py = PyObject_CallFunction(u->ext_hook, "(is#)", typecode, pos, (Py_ssize_t)length-1);
268+
py = PyObject_CallFunction(u->ext_hook, (char*)"(is#)", typecode, pos, (Py_ssize_t)length-1);
269269
#else
270-
py = PyObject_CallFunction(u->ext_hook, "(iy#)", typecode, pos, (Py_ssize_t)length-1);
270+
py = PyObject_CallFunction(u->ext_hook, (char*)"(iy#)", typecode, pos, (Py_ssize_t)length-1);
271271
#endif
272272
if (!py)
273273
return -1;

pandas/src/msgpack/unpack_template.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static inline int unpack_execute(unpack_context* ctx, const char* data, size_t l
8989
*/
9090
unpack_user* user = &ctx->user;
9191

92-
PyObject* obj;
92+
PyObject* obj = NULL;
9393
unpack_stack* c = NULL;
9494

9595
int ret;

pandas/src/parser/io.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ typedef struct _file_source {
2929

3030
#define FS(source) ((file_source *)source)
3131

32-
#if !defined(_WIN32)
32+
#if !defined(_WIN32) && !defined(HAVE_MMAP)
3333
#define HAVE_MMAP
3434
#endif
3535

pandas/src/parser/tokenizer.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@ double xstrtod(const char *str, char **endptr, char decimal,
21852185
p++;
21862186
num_digits++;
21872187

2188-
p += (tsep != '\0' & *p == tsep);
2188+
p += (tsep != '\0' && *p == tsep);
21892189
}
21902190

21912191
// Process decimal part
@@ -2358,7 +2358,7 @@ double precise_xstrtod(const char *str, char **endptr, char decimal,
23582358
++exponent;
23592359

23602360
p++;
2361-
p += (tsep != '\0' & *p == tsep);
2361+
p += (tsep != '\0' && *p == tsep);
23622362
}
23632363

23642364
// Process decimal part

pandas/src/parser/tokenizer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ double xstrtod(const char *p, char **q, char decimal, char sci, char tsep, int s
267267
double precise_xstrtod(const char *p, char **q, char decimal, char sci, char tsep, int skip_trailing);
268268
double round_trip(const char *p, char **q, char decimal, char sci, char tsep, int skip_trailing);
269269
//int P_INLINE to_complex(char *item, double *p_real, double *p_imag, char sci, char decimal);
270-
int P_INLINE to_longlong(char *item, long long *p_value);
270+
//int P_INLINE to_longlong(char *item, long long *p_value);
271271
//int P_INLINE to_longlong_thousands(char *item, long long *p_value, char tsep);
272272
int to_boolean(const char *item, uint8_t *val);
273273

pandas/src/period_helper.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ static int floordiv(int x, int divisor) {
3030
}
3131
}
3232

33-
static asfreq_info NULL_AF_INFO;
34-
3533
/* Table with day offsets for each month (0-based, without and with leap) */
3634
static int month_offset[2][13] = {
3735
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
@@ -299,7 +297,7 @@ PANDAS_INLINE int get_freq_group_index(int freq) {
299297
return freq/1000;
300298
}
301299

302-
static int calc_conversion_factors_matrix_size() {
300+
static int calc_conversion_factors_matrix_size(void) {
303301
int matrix_size = 0;
304302
int index;
305303
for (index=0;; index++) {
@@ -348,7 +346,7 @@ static npy_int64 calculate_conversion_factor(int start_value, int end_value) {
348346
return conversion_factor;
349347
}
350348

351-
static void populate_conversion_factors_matrix() {
349+
static void populate_conversion_factors_matrix(void) {
352350
int row_index_index;
353351
int row_value, row_index;
354352
int column_index_index;

pandas/src/ujson/lib/ultrajsondec.c

-6
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ static JSOBJ SetError( struct DecoderState *ds, int offset, const char *message)
7676
return NULL;
7777
}
7878

79-
static void ClearError( struct DecoderState *ds)
80-
{
81-
ds->dec->errorOffset = 0;
82-
ds->dec->errorStr = NULL;
83-
}
84-
8579
double createDouble(double intNeg, double intValue, double frcValue, int frcDecimalCount)
8680
{
8781
static const double g_pow10[] = {1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001,0.0000001, 0.00000001, 0.000000001, 0.0000000001, 0.00000000001, 0.000000000001, 0.0000000000001, 0.00000000000001, 0.000000000000001};

0 commit comments

Comments
 (0)