Skip to content

hash: change 'slots' to size_t from int#13502

Closed
bagder wants to merge 1 commit intomasterfrom
bagder/hash-size_t-slots
Closed

hash: change 'slots' to size_t from int#13502
bagder wants to merge 1 commit intomasterfrom
bagder/hash-size_t-slots

Conversation

@bagder
Copy link
Member

@bagder bagder commented Apr 30, 2024

  • an unsigned type makes more sense
  • size_t seems suitable
  • on 64 bit args, the struct alignment makes the new Curl_hash remain the same size

Ref: #13489

- an unsigned type makes more sense
- size_t seems suitable
- on 64 bit args, the struct alignment makes the new Curl_hash remain
  the same size
@bagder bagder added the tidy-up label Apr 30, 2024
@bagder bagder closed this in cc907e8 Apr 30, 2024
@bagder bagder deleted the bagder/hash-size_t-slots branch April 30, 2024 08:23
vszakats added a commit to vszakats/curl that referenced this pull request Apr 30, 2024
also fixup (32-bit i686-linux-gnu-gcc-11)
```
hash.c:282:7: error: conversion to ‘size_t’ {aka ‘unsigned int’} from ‘unsigned int’ may change the sign of the result [-Werror=sign-conversion]
  282 |     h ^= (size_t)*key_str++;
      |       ^~
```
Ref: https://github.com/curl/curl/actions/runs/8862007379/job/24334479063?pr=13489#step:6:235

Also address FIXMEs

Rebased on fixes cc907e8 curl#13502
vszakats added a commit that referenced this pull request May 12, 2024
Follow-up to cc907e8 #13502
Cherry-picked from #13489
Closes #13601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant