Skip to content

Commit edb572c

Browse files
committed
MAINT: get rid of some compiler warnings
* uninitialized pointer * unused variables * unused function * ISO C prototypes * cimport * * useless cast before snprintf
1 parent 01995b2 commit edb572c

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

pandas/src/datetime/np_datetime_strings.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ get_localtime(NPY_TIME_T *ts, struct tm *tms)
117117
return -1;
118118
}
119119

120+
#if 0
120121
/*
121122
* Wraps `gmtime` functionality for multiple platforms. This
122123
* converts a time value to a time structure in UTC.
@@ -161,6 +162,7 @@ get_gmtime(NPY_TIME_T *ts, struct tm *tms)
161162
"to a UTC time", func_name);
162163
return -1;
163164
}
165+
#endif
164166

165167
/*
166168
* Converts a datetimestruct in UTC to a datetimestruct in local time,
@@ -1144,7 +1146,7 @@ make_iso_8601_datetime(pandas_datetimestruct *dts, char *outstr, int outlen,
11441146
#ifdef _WIN32
11451147
tmplen = _snprintf(substr, sublen, "%04" NPY_INT64_FMT, dts->year);
11461148
#else
1147-
tmplen = snprintf(substr, sublen, "%04" NPY_INT64_FMT, (long long)dts->year);
1149+
tmplen = snprintf(substr, sublen, "%04" NPY_INT64_FMT, dts->year);
11481150
#endif
11491151
/* If it ran out of space or there isn't space for the NULL terminator */
11501152
if (tmplen < 0 || tmplen > sublen) {

pandas/src/parse_helper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ static double xstrtod(const char *p, char **q, char decimal, char sci,
66

77
int to_double(char *item, double *p_value, char sci, char decimal, int *maybe_int)
88
{
9-
char *p_end;
9+
char *p_end = NULL;
1010

1111
*p_value = xstrtod(item, &p_end, decimal, sci, 1, maybe_int);
1212

pandas/src/period_helper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,5 @@ double getAbsTime(int freq, npy_int64 dailyDate, npy_int64 originalDate);
166166
char *c_strftime(struct date_info *dinfo, char *fmt);
167167
int get_yq(npy_int64 ordinal, int freq, int *quarter, int *year);
168168

169-
void initialize_daytime_conversion_factor_matrix();
169+
void initialize_daytime_conversion_factor_matrix(void);
170170
#endif

pandas/tslib.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cdef extern from "datetime_helper.h":
2929
double total_seconds(object)
3030

3131
# this is our datetime.pxd
32-
from datetime cimport *
32+
from datetime cimport cmp_pandas_datetimestruct
3333
from util cimport is_integer_object, is_float_object, is_datetime64_object, is_timedelta64_object
3434

3535
from libc.stdlib cimport free

0 commit comments

Comments
 (0)