Skip to content

Macpython 32 bit build fixup #34416

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
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
12 changes: 8 additions & 4 deletions pandas/_libs/hashtable_func_helper.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ cpdef value_count_{{dtype}}({{c_type}}[:] values, bint dropna):
int64_t[:] result_counts
{{endif}}

Py_ssize_t k
# Don't use Py_ssize_t, since table.n_buckets is unsigned
khiter_t k

table = kh_init_{{ttype}}()
{{if dtype == 'object'}}
Expand Down Expand Up @@ -132,7 +133,8 @@ def duplicated_{{dtype}}(const {{c_type}}[:] values, object keep='first'):
{{if dtype != 'object'}}
{{dtype}}_t value
{{endif}}
Py_ssize_t k, i, n = len(values)
Py_ssize_t i, n = len(values)
khiter_t k
kh_{{ttype}}_t *table = kh_init_{{ttype}}()
ndarray[uint8_t, ndim=1, cast=True] out = np.empty(n, dtype='bool')

Expand Down Expand Up @@ -222,7 +224,8 @@ def ismember_{{dtype}}(const {{c_type}}[:] arr, {{c_type}}[:] values):
boolean ndarry len of (arr)
"""
cdef:
Py_ssize_t i, n, k
Py_ssize_t i, n
khiter_t k
int ret = 0
ndarray[uint8_t] result
{{c_type}} val
Expand Down Expand Up @@ -295,7 +298,8 @@ def mode_{{dtype}}({{ctype}}[:] values, bint dropna):
cdef:
int count, max_count = 1
int j = -1 # so you can do +=
Py_ssize_t k
# Don't use Py_ssize_t, since table.n_buckets is unsigned
khiter_t k
kh_{{table_type}}_t *table
ndarray[{{ctype}}] modes

Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/src/parser/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ int skip_this_line(parser_t *self, int64_t rownum) {
}

int tokenize_bytes(parser_t *self,
size_t line_limit, int64_t start_lines) {
size_t line_limit, uint64_t start_lines) {
int64_t i;
uint64_t slen;
int should_skip;
Expand Down Expand Up @@ -1348,7 +1348,7 @@ int parser_trim_buffers(parser_t *self) {

int _tokenize_helper(parser_t *self, size_t nrows, int all) {
int status = 0;
int64_t start_lines = self->lines;
uint64_t start_lines = self->lines;

if (self->state == FINISHED) {
return 0;
Expand Down
6 changes: 4 additions & 2 deletions pandas/_libs/tslibs/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ from pandas._libs.tslibs.tzconversion cimport tz_convert_utc_to_tzlocal

cdef:
enum:
INT32_MIN = -2_147_483_648
INT32_MIN = -2_147_483_648LL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
INT32_MIN = -2_147_483_648LL
INT32_MIN = -2_147_483_648L

Rather pedantic but the size of a long is at least 32 bits, so no need for long long here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI here's some interesting info on why we probably need this suffix depending on the architecture / compilation standard:

https://stackoverflow.com/questions/9941261/warning-this-decimal-constant-is-unsigned-only-in-iso-c90#20910712

Copy link
Member

@WillAyd WillAyd May 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ignore original comment; I think LL might be correct here



ctypedef struct asfreq_info:
Expand Down Expand Up @@ -108,9 +108,11 @@ cdef extern from *:
#define FR_UND -10000 /* Undefined */

// must use npy typedef b/c int64_t is aliased in cython-generated c
// unclear why we need LL for that row.
// see https://github.com/pandas-dev/pandas/pull/34416/
static npy_int64 daytime_conversion_factor_matrix[7][7] = {
{1, 24, 1440, 86400, 86400000, 86400000000, 86400000000000},
{0, 1, 60, 3600, 3600000, 3600000000, 3600000000000},
{0LL, 1LL, 60LL, 3600LL, 3600000LL, 3600000000LL, 3600000000000LL},
{0, 0, 1, 60, 60000, 60000000, 60000000000},
{0, 0, 0, 1, 1000, 1000000, 1000000000},
{0, 0, 0, 0, 1, 1000, 1000000},
Expand Down