Skip to content
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

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

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Feb 21, 2024

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
Copy link

codecov bot commented Feb 21, 2024

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
65 checks passed
@iphydf iphydf deleted the offline-peer branch February 22, 2024 00:19
@@ -2682,7 +2683,7 @@ const char *tox_err_conference_peer_query_to_string(Tox_Err_Conference_Peer_Quer
* peer_number for the functions querying these peers. Return value is
* unspecified on failure.
*/
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
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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants