Skip to content

Commit

Permalink
Test commit for clang
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimes committed Aug 25, 2024
1 parent 66f9dc4 commit 43327fc
Show file tree
Hide file tree
Showing 5 changed files with 1,076 additions and 1,174 deletions.
15 changes: 1 addition & 14 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,4 @@
# A clang-format style that approximates Python's PEP 7
# Useful for IDE integration
BasedOnStyle: LLVM
AlwaysBreakAfterReturnType: All
AllowShortIfStatementsOnASingleLine: false
AlignAfterOpenBracket: Align
BreakBeforeBraces: Stroustrup
ColumnLimit: 79
DerivePointerAlignment: false
IndentWidth: 4
Language: Cpp
PointerAlignment: Right
ReflowComments: true
SpaceBeforeParens: ControlStatements
SpacesInParentheses: false
TabWidth: 4
UseTab: Never
AlwaysBreakAfterReturnType: All
47 changes: 23 additions & 24 deletions src/mmh3/hashlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,27 @@
* of PyObject_GetBuffer. Sets an exception and issues the erraction
* on any errors, e.g. 'return NULL' or 'goto error'.
*/
#define GET_BUFFER_VIEW_OR_ERROR(obj, viewp, erraction) \
do { \
if (PyUnicode_Check((obj))) { \
PyErr_SetString(PyExc_TypeError, \
"Strings must be encoded before hashing"); \
erraction; \
} \
if (!PyObject_CheckBuffer((obj))) { \
PyErr_SetString(PyExc_TypeError, \
"object supporting the buffer API required"); \
erraction; \
} \
if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \
erraction; \
} \
if ((viewp)->ndim > 1) { \
PyErr_SetString(PyExc_BufferError, \
"Buffer must be single dimension"); \
PyBuffer_Release((viewp)); \
erraction; \
} \
} while (0)
#define GET_BUFFER_VIEW_OR_ERROR(obj, viewp, erraction) \
do { \
if (PyUnicode_Check((obj))) { \
PyErr_SetString(PyExc_TypeError, \
"Strings must be encoded before hashing"); \
erraction; \
} \
if (!PyObject_CheckBuffer((obj))) { \
PyErr_SetString(PyExc_TypeError, \
"object supporting the buffer API required"); \
erraction; \
} \
if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \
erraction; \
} \
if ((viewp)->ndim > 1) { \
PyErr_SetString(PyExc_BufferError, "Buffer must be single dimension"); \
PyBuffer_Release((viewp)); \
erraction; \
} \
} while (0)

#define GET_BUFFER_VIEW_OR_ERROUT(obj, viewp) \
GET_BUFFER_VIEW_OR_ERROR(obj, viewp, return NULL)
#define GET_BUFFER_VIEW_OR_ERROUT(obj, viewp) \
GET_BUFFER_VIEW_OR_ERROR(obj, viewp, return NULL)
Loading

0 comments on commit 43327fc

Please sign in to comment.