-
Notifications
You must be signed in to change notification settings - Fork 3k
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: Convert C-Style Casts to C++-Style Type Casts #36416
base: master
Are you sure you want to change the base?
Conversation
@abd-770 Thanks for your contribution. Please submit with DCO, see the contributing guide https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco. |
Invalid PR Title Format Detected Your PR submission does not adhere to our required standards. To ensure clarity and consistency, please meet the following criteria:
Required Title Structure:
Where Example:
Please review and update your PR to comply with these guidelines. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #36416 +/- ##
==========================================
+ Coverage 81.05% 82.97% +1.91%
==========================================
Files 1370 1081 -289
Lines 191486 165618 -25868
==========================================
- Hits 155215 137421 -17794
+ Misses 30788 22718 -8070
+ Partials 5483 5479 -4
|
to @abd-770 and whoever reviews these changes. These automated changes need to be reviewed VERY CAREFULLY and altered manually. std::vector<uint8_t> vals;
auto execute_sub_batch = [](Index* index_ptr,
const std::vector<uint8_t>& vals) {
TermIndexFunc<bool> func;
return std::move(func(index_ptr, vals.size(), (bool*)vals.data()));
};
auto res = ProcessIndexChunks<bool>(execute_sub_batch, vals); got changed into std::vector<uint8_t> vals;
auto execute_sub_batch = [](Index* index_ptr,
const std::vector<uint8_t>& vals) {
TermIndexFunc<bool> func;
return std::move(func(index_ptr, vals.size(),
const_cast<bool*>(static_cast<const bool*>(
static_cast<const void*>(vals.data())
))));
};
auto res = ProcessIndexChunks<bool>(execute_sub_batch, vals); while at a first glance the problem may be fixed by changing |
db8faa5
to
7a38102
Compare
@abd-770 go-sdk check failed, comment |
@abd-770 E2e jenkins job failed, comment |
rerun go-sdk |
/run-cpu-e2e |
@abd-770 E2e jenkins job failed, comment |
@abd-770 go-sdk check failed, comment |
@alexanderguzhva can you tag someone from the community to review this pr. Thanks |
@abd-770 E2e jenkins job failed, comment |
@abd-770 go-sdk check failed, comment |
@abd-770 would it be possible to run |
7a38102
to
1d8b9d4
Compare
|
||
auto status = CStatus(); | ||
status.error_code = milvus::Success; | ||
status.error_msg = ""; | ||
auto group = (CPlaceholderGroup)res.release(); | ||
auto group = static_cast<CPlaceholderGroup>(res.release()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, is it really CPlaceholderGroup
and not CPlaceholderGroup*
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
CPlaceholderGroup is defined as void *.
typedef void* CPlaceholderGroup;
@@ -147,7 +149,7 @@ CreateRetrievePlanByExpr(CCollection c_col, | |||
auto status = CStatus(); | |||
status.error_code = milvus::Success; | |||
status.error_msg = ""; | |||
auto plan = (CRetrievePlan)res.release(); | |||
auto plan = static_cast<CRetrievePlan>(res.release()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. They are defined as void*
typedef void* CSearchPlan;
typedef void* CPlaceholderGroup;
typedef void* CRetrievePlan;
@abd-770 I've added some comments, let's wait until my colleagues make a review. Thanks. |
6e58ba0
to
a05a37a
Compare
issue: milvus-io#35900 Signed-off-by: Abdullah Ahmed <abdullahdb6@gmail.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: abd-770 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@alexanderguzhva I have made changes to the code based on your first review comment. |
@alexanderguzhva @godchen0212 @bigsheeper any updates? |
@abd-770 I gave all of my comments. Waiting for my colleagues. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hey @alexanderguzhva @godchen0212 @bigsheeper , |
@abd-770 go-sdk check failed, comment |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
/reopen |
Issue:
#35900
Description:
This pull request replaces the instances of C-style casting in the codebase with C++ style type casting (static_cast, const_cast, and reinterpret_cast). This change is aimed at: