Skip to content

CLN/BUILD: Fix warnings on build #12471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v0.18.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ Performance Improvements

Bug Fixes
~~~~~~~~~

- Removed some compiler warnings (:issue:`5385`)
2 changes: 1 addition & 1 deletion pandas/src/datetime/np_datetime_strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ parse_iso_8601_datetime(char *str, int len,
* an error code will be retuned because the date is ambigous
*/
int has_sep = 0;
char sep;
char sep = '\0';
char valid_sep[] = {'-', '.', '/', '\\', ' '};
int valid_sep_len = 5;

Expand Down
2 changes: 1 addition & 1 deletion pandas/src/klib/khash.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ typedef khint_t khiter_t;
#define __ac_set_isempty_false(flag, i) (flag[i>>5]&=~(1ul<<(i&0x1fU)))
#define __ac_set_isempty_true(flag, i) (flag[i>>5]|=(1ul<<(i&0x1fU)))
#define __ac_set_isboth_false(flag, i) __ac_set_isempty_false(flag, i)
#define __ac_set_isdel_true(flag, i) (0)
#define __ac_set_isdel_true(flag, i) ((void)0)

#ifdef KHASH_LINEAR
#define __ac_inc(k, m) 1
Expand Down
4 changes: 2 additions & 2 deletions pandas/src/msgpack/unpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ static inline int unpack_callback_ext(unpack_user* u, const char* base, const ch
}
// length also includes the typecode, so the actual data is length-1
#if PY_MAJOR_VERSION == 2
py = PyObject_CallFunction(u->ext_hook, "(is#)", typecode, pos, (Py_ssize_t)length-1);
py = PyObject_CallFunction(u->ext_hook, (char*)"(is#)", typecode, pos, (Py_ssize_t)length-1);
#else
py = PyObject_CallFunction(u->ext_hook, "(iy#)", typecode, pos, (Py_ssize_t)length-1);
py = PyObject_CallFunction(u->ext_hook, (char*)"(iy#)", typecode, pos, (Py_ssize_t)length-1);
#endif
if (!py)
return -1;
Expand Down
2 changes: 1 addition & 1 deletion pandas/src/msgpack/unpack_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static inline int unpack_execute(unpack_context* ctx, const char* data, size_t l
*/
unpack_user* user = &ctx->user;

PyObject* obj;
PyObject* obj = NULL;
unpack_stack* c = NULL;

int ret;
Expand Down
2 changes: 1 addition & 1 deletion pandas/src/parser/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ typedef struct _file_source {

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

#if !defined(_WIN32)
#if !defined(_WIN32) && !defined(HAVE_MMAP)
#define HAVE_MMAP
#endif

Expand Down
4 changes: 2 additions & 2 deletions pandas/src/parser/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2185,7 +2185,7 @@ double xstrtod(const char *str, char **endptr, char decimal,
p++;
num_digits++;

p += (tsep != '\0' & *p == tsep);
p += (tsep != '\0' && *p == tsep);
}

// Process decimal part
Expand Down Expand Up @@ -2358,7 +2358,7 @@ double precise_xstrtod(const char *str, char **endptr, char decimal,
++exponent;

p++;
p += (tsep != '\0' & *p == tsep);
p += (tsep != '\0' && *p == tsep);
}

// Process decimal part
Expand Down
2 changes: 1 addition & 1 deletion pandas/src/parser/tokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ double xstrtod(const char *p, char **q, char decimal, char sci, char tsep, int s
double precise_xstrtod(const char *p, char **q, char decimal, char sci, char tsep, int skip_trailing);
double round_trip(const char *p, char **q, char decimal, char sci, char tsep, int skip_trailing);
//int P_INLINE to_complex(char *item, double *p_real, double *p_imag, char sci, char decimal);
int P_INLINE to_longlong(char *item, long long *p_value);
//int P_INLINE to_longlong(char *item, long long *p_value);
//int P_INLINE to_longlong_thousands(char *item, long long *p_value, char tsep);
int to_boolean(const char *item, uint8_t *val);

Expand Down
6 changes: 2 additions & 4 deletions pandas/src/period_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ static int floordiv(int x, int divisor) {
}
}

static asfreq_info NULL_AF_INFO;

/* Table with day offsets for each month (0-based, without and with leap) */
static int month_offset[2][13] = {
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
Expand Down Expand Up @@ -299,7 +297,7 @@ PANDAS_INLINE int get_freq_group_index(int freq) {
return freq/1000;
}

static int calc_conversion_factors_matrix_size() {
static int calc_conversion_factors_matrix_size(void) {
int matrix_size = 0;
int index;
for (index=0;; index++) {
Expand Down Expand Up @@ -348,7 +346,7 @@ static npy_int64 calculate_conversion_factor(int start_value, int end_value) {
return conversion_factor;
}

static void populate_conversion_factors_matrix() {
static void populate_conversion_factors_matrix(void) {
int row_index_index;
int row_value, row_index;
int column_index_index;
Expand Down
6 changes: 0 additions & 6 deletions pandas/src/ujson/lib/ultrajsondec.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ static JSOBJ SetError( struct DecoderState *ds, int offset, const char *message)
return NULL;
}

static void ClearError( struct DecoderState *ds)
{
ds->dec->errorOffset = 0;
ds->dec->errorStr = NULL;
}

double createDouble(double intNeg, double intValue, double frcValue, int frcDecimalCount)
{
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};
Expand Down