Skip to content

fix: Correct type for conference offline peer numbers.#2704

Merged
toktok-releaser merged 1 commit into
TokTok:masterfrom
iphydf:offline-peer
Feb 22, 2024
Merged

fix: Correct type for conference offline peer numbers.#2704
toktok-releaser merged 1 commit into
TokTok:masterfrom
iphydf:offline-peer

Conversation

@iphydf

@iphydf iphydf commented Feb 21, 2024

Copy link
Copy Markdown
Member

Also return count as uint32_t, not as peer number.


This change is Reviewable

Also return count as uint32_t, not as peer number.
@iphydf iphydf added this to the v0.2.19 milestone Feb 21, 2024
@iphydf iphydf marked this pull request as ready for review February 21, 2024 23:37
@codecov

codecov Bot commented Feb 21, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0627c36) 73.05% compared to head (be82a3e) 73.10%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2704      +/-   ##
==========================================
+ Coverage   73.05%   73.10%   +0.04%     
==========================================
  Files         149      149              
  Lines       30517    30517              
==========================================
+ Hits        22294    22309      +15     
+ Misses       8223     8208      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@toktok-releaser toktok-releaser merged commit be82a3e into TokTok:master Feb 22, 2024
@iphydf iphydf deleted the offline-peer branch February 22, 2024 00:19
Comment thread toxcore/tox.h
*/
Tox_Conference_Peer_Number tox_conference_peer_count(
uint32_t tox_conference_peer_count(
const Tox *tox, Tox_Conference_Number conference_number, Tox_Err_Conference_Peer_Query *error);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's an interesting function. Thinking ahead, I wonder what would be the best way to change this to use opaque pointers in v0.3.0. Change it to return an array of Tox_Conference_Offline_Peer* opaque pointers? Or perhaps keep it as it is but add a helper function that uses this peer count as an index and returns an opaque Tox_Conference_Offline_Peer* to be used with other functions?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Probably the latter, yes. Returning arrays of pointers makes things complicated and less safe (no bounds checks on C arrays).

@pull-request-attention pull-request-attention Bot assigned nurupo and unassigned iphydf Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants