Skip to content

Commit 7f1cbfc

Browse files
committed
CI: cleanup .c files for cpplint>1.4
1 parent 5e73a4f commit 7f1cbfc

File tree

10 files changed

+24
-24
lines changed

10 files changed

+24
-24
lines changed

pandas/_libs/src/compat_helper.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ the macro, which restores compat.
2929
#ifndef PYPY_VERSION
3030
# if PY_VERSION_HEX < 0x03070000 && defined(PySlice_GetIndicesEx)
3131
# undef PySlice_GetIndicesEx
32-
# endif
33-
#endif
32+
# endif // PY_VERSION_HEX
33+
#endif // PYPY_VERSION
3434

3535
PANDAS_INLINE int slice_get_indices(PyObject *s,
3636
Py_ssize_t length,
@@ -44,7 +44,7 @@ PANDAS_INLINE int slice_get_indices(PyObject *s,
4444
#else
4545
return PySlice_GetIndicesEx((PySliceObject *)s, length, start,
4646
stop, step, slicelength);
47-
#endif
47+
#endif // PY_VERSION_HEX
4848
}
4949

5050
#endif // PANDAS__LIBS_SRC_COMPAT_HELPER_H_

pandas/_libs/src/inline_helper.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The full license is in the LICENSE file, distributed with this software.
1919
#define PANDAS_INLINE static inline
2020
#else
2121
#define PANDAS_INLINE
22-
#endif
23-
#endif
22+
#endif // __GNUC__
23+
#endif // PANDAS_INLINE
2424

2525
#endif // PANDAS__LIBS_SRC_INLINE_HELPER_H_

pandas/_libs/src/parse_helper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ int to_double(char *item, double *p_value, char sci, char decimal,
3030
#if PY_VERSION_HEX < 0x02060000
3131
#define PyBytes_Check PyString_Check
3232
#define PyBytes_AS_STRING PyString_AS_STRING
33-
#endif
33+
#endif // PY_VERSION_HEX
3434

3535
int floatify(PyObject *str, double *result, int *maybe_int) {
3636
int status;

pandas/_libs/src/parser/io.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The full license is in the LICENSE file, distributed with this software.
1515

1616
#ifndef O_BINARY
1717
#define O_BINARY 0
18-
#endif /* O_BINARY */
18+
#endif // O_BINARY
1919

2020
/*
2121
On-disk FILE, uncompressed
@@ -277,4 +277,4 @@ void *buffer_mmap_bytes(void *source, size_t nbytes, size_t *bytes_read,
277277
return NULL;
278278
}
279279

280-
#endif
280+
#endif // HAVE_MMAP

pandas/_libs/src/parser/io.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ typedef struct _file_source {
2525

2626
#if !defined(_WIN32) && !defined(HAVE_MMAP)
2727
#define HAVE_MMAP
28-
#endif
28+
#endif // HAVE_MMAP
2929

3030
typedef struct _memory_map {
3131
int fd;

pandas/_libs/src/parser/tokenizer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@ int main(int argc, char *argv[]) {
14801480

14811481
return 0;
14821482
}
1483-
#endif
1483+
#endif // TEST
14841484

14851485
// ---------------------------------------------------------------------------
14861486
// Implementation of xstrtod

pandas/_libs/src/parser/tokenizer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ See LICENSE for the license
4242

4343
#if defined(_MSC_VER)
4444
#define strtoll _strtoi64
45-
#endif
45+
#endif // _MSC_VER
4646

4747
/*
4848
@@ -75,7 +75,7 @@ See LICENSE for the license
7575
#define TRACE(X) printf X;
7676
#else
7777
#define TRACE(X)
78-
#endif
78+
#endif // VERBOSE
7979

8080
#define PARSER_OUT_OF_MEMORY -1
8181

pandas/_libs/tslibs/src/datetime/np_datetime.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This file is derived from NumPy 1.7. See NUMPY_LICENSE.txt
3030

3131
#if PY_MAJOR_VERSION >= 3
3232
#define PyInt_AsLong PyLong_AsLong
33-
#endif
33+
#endif // PyInt_AsLong
3434

3535
const npy_datetimestruct _NS_MIN_DTS = {
3636
1677, 9, 21, 0, 12, 43, 145225, 0, 0};

pandas/_libs/tslibs/src/datetime/np_datetime_strings.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ int make_iso_8601_datetime(npy_datetimestruct *dts, char *outstr, int outlen,
609609
tmplen = _snprintf(substr, sublen, "%04" NPY_INT64_FMT, dts->year);
610610
#else
611611
tmplen = snprintf(substr, sublen, "%04" NPY_INT64_FMT, dts->year);
612-
#endif
612+
#endif // _WIN32
613613
/* If it ran out of space or there isn't space for the NULL terminator */
614614
if (tmplen < 0 || tmplen > sublen) {
615615
goto string_too_short;

pandas/util/move.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ The full license is in the LICENSE file, distributed with this software.
1919

2020
/* in python 3, we cannot intern bytes objects so this is always false */
2121
#define PyString_CHECK_INTERNED(cs) 0
22-
#endif /* !COMPILING_IN_PY2 */
22+
#endif // !COMPILING_IN_PY2
2323

24-
#ifndef Py_TPFLAGS_HAVE_GETCHARBUFFER
24+
#ifndef
2525
#define Py_TPFLAGS_HAVE_GETCHARBUFFER 0
26-
#endif
26+
#endif // Py_TPFLAGS_HAVE_GETCHARBUFFER
2727

2828
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
2929
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
30-
#endif
30+
#endif // Py_TPFLAGS_HAVE_NEWBUFFER
3131

3232
static PyObject *badmove; /* bad move exception class */
3333

@@ -85,14 +85,14 @@ static PyBufferProcs stolenbuf_as_buffer = {
8585
(getbufferproc) stolenbuf_getbuffer,
8686
};
8787

88-
#else /* Python 3 */
88+
#else // Python 3
8989

9090
static PyBufferProcs stolenbuf_as_buffer = {
9191
(getbufferproc) stolenbuf_getbuffer,
9292
NULL,
9393
};
9494

95-
#endif /* COMPILING_IN_PY2 */
95+
#endif // COMPILING_IN_PY2
9696

9797
PyDoc_STRVAR(stolenbuf_doc,
9898
"A buffer that is wrapping a stolen bytes object's buffer.");
@@ -208,7 +208,7 @@ static PyModuleDef move_module = {
208208
-1,
209209
methods,
210210
};
211-
#endif /* !COMPILING_IN_PY2 */
211+
#endif // !COMPILING_IN_PY2
212212

213213
PyDoc_STRVAR(
214214
badmove_doc,
@@ -231,7 +231,7 @@ PyInit__move(void)
231231
#else
232232
#define ERROR_RETURN
233233
init_move(void)
234-
#endif /* !COMPILING_IN_PY2 */
234+
#endif // !COMPILING_IN_PY2
235235
{
236236
PyObject *m;
237237

@@ -250,7 +250,7 @@ init_move(void)
250250
if (!(m = PyModule_Create(&move_module)))
251251
#else
252252
if (!(m = Py_InitModule(MODULE_NAME, methods)))
253-
#endif /* !COMPILING_IN_PY2 */
253+
#endif // !COMPILING_IN_PY2
254254
{
255255
return ERROR_RETURN;
256256
}
@@ -269,5 +269,5 @@ init_move(void)
269269

270270
#if !COMPILING_IN_PY2
271271
return m;
272-
#endif /* !COMPILING_IN_PY2 */
272+
#endif // !COMPILING_IN_PY2
273273
}

0 commit comments

Comments
 (0)