Skip to content

CLN: Use #pragma once instead of include guards #52635

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

Merged
merged 1 commit into from
Apr 12, 2023
Merged
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
4 changes: 1 addition & 3 deletions pandas/_libs/pd_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ All rights reserved.
Distributed under the terms of the BSD Simplified License.

*/
#ifndef PANDAS__LIBS_PD_PARSER_H_
#define PANDAS__LIBS_PD_PARSER_H_
#pragma once

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -110,4 +109,3 @@ static PandasParser_CAPI *PandasParserAPI = NULL;
#ifdef __cplusplus
}
#endif
#endif // PANDAS__LIBS_PD_PARSER_H_
5 changes: 1 addition & 4 deletions pandas/_libs/src/headers/portable.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _PANDAS_PORTABLE_H_
#define _PANDAS_PORTABLE_H_
#pragma once

#include <string.h>

Expand All @@ -14,5 +13,3 @@
#define isspace_ascii(c) (((c) == ' ') || (((unsigned)(c) - '\t') < 5))
#define toupper_ascii(c) ((((unsigned)(c) - 'a') < 26) ? ((c) & 0x5f) : (c))
#define tolower_ascii(c) ((((unsigned)(c) - 'A') < 26) ? ((c) | 0x20) : (c))

#endif
5 changes: 1 addition & 4 deletions pandas/_libs/src/inline_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Distributed under the terms of the BSD Simplified License.
The full license is in the LICENSE file, distributed with this software.
*/

#ifndef PANDAS__LIBS_SRC_INLINE_HELPER_H_
#define PANDAS__LIBS_SRC_INLINE_HELPER_H_
#pragma once

#ifndef PANDAS_INLINE
#if defined(__clang__)
Expand All @@ -23,5 +22,3 @@ The full license is in the LICENSE file, distributed with this software.
#define PANDAS_INLINE
#endif // __GNUC__
#endif // PANDAS_INLINE

#endif // PANDAS__LIBS_SRC_INLINE_HELPER_H_
5 changes: 1 addition & 4 deletions pandas/_libs/src/parser/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Distributed under the terms of the BSD Simplified License.
The full license is in the LICENSE file, distributed with this software.
*/

#ifndef PANDAS__LIBS_SRC_PARSER_IO_H_
#define PANDAS__LIBS_SRC_PARSER_IO_H_
#pragma once

#define PY_SSIZE_T_CLEAN
#include <Python.h>
Expand All @@ -30,5 +29,3 @@ int del_rd_source(void *src);

void *buffer_rd_bytes(void *source, size_t nbytes, size_t *bytes_read,
int *status, const char *encoding_errors);

#endif // PANDAS__LIBS_SRC_PARSER_IO_H_
5 changes: 1 addition & 4 deletions pandas/_libs/src/parser/tokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ See LICENSE for the license

*/

#ifndef PANDAS__LIBS_SRC_PARSER_TOKENIZER_H_
#define PANDAS__LIBS_SRC_PARSER_TOKENIZER_H_
#pragma once

#define PY_SSIZE_T_CLEAN
#include <Python.h>
Expand Down Expand Up @@ -232,5 +231,3 @@ double precise_xstrtod(const char *p, char **q, char decimal,
double round_trip(const char *p, char **q, char decimal, char sci, char tsep,
int skip_trailing, int *error, int *maybe_int);
int to_boolean(const char *item, uint8_t *val);

#endif // PANDAS__LIBS_SRC_PARSER_TOKENIZER_H_
5 changes: 1 addition & 4 deletions pandas/_libs/src/skiplist.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Port of Wes McKinney's Cython version of Raymond Hettinger's original pure
Python recipe (https://rhettinger.wordpress.com/2010/02/06/lost-knowledge/)
*/

#ifndef PANDAS__LIBS_SRC_SKIPLIST_H_
#define PANDAS__LIBS_SRC_SKIPLIST_H_
#pragma once

#include <math.h>
#include <stdio.h>
Expand Down Expand Up @@ -296,5 +295,3 @@ PANDAS_INLINE int skiplist_remove(skiplist_t *skp, double value) {
--(skp->size);
return 1;
}

#endif // PANDAS__LIBS_SRC_SKIPLIST_H_
5 changes: 1 addition & 4 deletions pandas/_libs/src/ujson/lib/ultrajson.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ tree doesn't have cyclic references.

*/

#ifndef PANDAS__LIBS_SRC_UJSON_LIB_ULTRAJSON_H_
#define PANDAS__LIBS_SRC_UJSON_LIB_ULTRAJSON_H_
#pragma once

#include <stdio.h>
#include <wchar.h>
Expand Down Expand Up @@ -313,5 +312,3 @@ typedef struct __JSONObjectDecoder {
EXPORTFUNCTION JSOBJ JSON_DecodeObject(JSONObjectDecoder *dec,
const char *buffer, size_t cbBuffer);
EXPORTFUNCTION void encode(JSOBJ, JSONObjectEncoder *, const char *, size_t);

#endif // PANDAS__LIBS_SRC_UJSON_LIB_ULTRAJSON_H_
5 changes: 1 addition & 4 deletions pandas/_libs/src/ujson/python/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ Numeric decoder derived from TCL library
* Copyright (c) 1994 Sun Microsystems, Inc.
*/

#ifndef PANDAS__LIBS_SRC_UJSON_PYTHON_VERSION_H_
#define PANDAS__LIBS_SRC_UJSON_PYTHON_VERSION_H_
#pragma once

#define UJSON_VERSION "1.33"

#endif // PANDAS__LIBS_SRC_UJSON_PYTHON_VERSION_H_
5 changes: 1 addition & 4 deletions pandas/_libs/tslibs/src/datetime/date_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ Distributed under the terms of the BSD Simplified License.
The full license is in the LICENSE file, distributed with this software.
*/

#ifndef PANDAS__LIBS_TSLIBS_SRC_DATETIME_DATE_CONVERSIONS_H_
#define PANDAS__LIBS_TSLIBS_SRC_DATETIME_DATE_CONVERSIONS_H_
#pragma once

#define PY_SSIZE_T_CLEAN
#include <Python.h>
Expand Down Expand Up @@ -35,5 +34,3 @@ char *PyDateTimeToIso(PyObject *obj, NPY_DATETIMEUNIT base, size_t *len);
npy_datetime PyDateTimeToEpoch(PyObject *dt, NPY_DATETIMEUNIT base);

char *int64ToIsoDuration(int64_t value, size_t *len);

#endif // PANDAS__LIBS_TSLIBS_SRC_DATETIME_DATE_CONVERSIONS_H_
6 changes: 1 addition & 5 deletions pandas/_libs/tslibs/src/datetime/np_datetime.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ This file is derived from NumPy 1.7. See NUMPY_LICENSE.txt

*/

#ifndef PANDAS__LIBS_TSLIBS_SRC_DATETIME_NP_DATETIME_H_
#define PANDAS__LIBS_TSLIBS_SRC_DATETIME_NP_DATETIME_H_
#pragma once

#ifndef NPY_NO_DEPRECATED_API
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
Expand Down Expand Up @@ -114,6 +113,3 @@ add_minutes_to_datetimestruct(npy_datetimestruct *dts, int minutes);
*/
PyArray_DatetimeMetaData get_datetime_metadata_from_dtype(
PyArray_Descr *dtype);


#endif // PANDAS__LIBS_TSLIBS_SRC_DATETIME_NP_DATETIME_H_
4 changes: 1 addition & 3 deletions pandas/_libs/tslibs/src/datetime/np_datetime_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ This file implements string parsing and creation for NumPy datetime.

*/

#ifndef PANDAS__LIBS_TSLIBS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
#define PANDAS__LIBS_TSLIBS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
#pragma once

#ifndef NPY_NO_DEPRECATED_API
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
Expand Down Expand Up @@ -108,4 +107,3 @@ make_iso_8601_datetime(npy_datetimestruct *dts, char *outstr, int outlen,
*/
int make_iso_8601_timedelta(pandas_timedeltastruct *tds, char *outstr,
size_t *outlen);
#endif // PANDAS__LIBS_TSLIBS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
4 changes: 1 addition & 3 deletions pandas/_libs/tslibs/src/datetime/pd_datetime.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ All rights reserved.
See NUMPY_LICENSE.txt for the license.
*/

#ifndef PANDAS__LIBS_TSLIBS_SRC_DATETIME_PD_DATETIME_H_
#define PANDAS__LIBS_TSLIBS_SRC_DATETIME_PD_DATETIME_H_
#pragma once

#ifndef NPY_NO_DEPRECATED_API
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
Expand Down Expand Up @@ -112,4 +111,3 @@ static PandasDateTime_CAPI *PandasDateTimeAPI = NULL;
#ifdef __cplusplus
}
#endif
#endif // PANDAS__LIBS_TSLIBS_SRC_DATETIME_PD_DATETIME_H_