Project

General

Profile

Actions

Feature #1799

closed

API refactor - double pointer was never used; single pointer suffices.

Added by John Robertson 9 days ago. Updated 9 days ago.

Status:
Rejected
Priority:
Normal
Category:
Server
Target version:
-
Start date:
12/04/2025
Due date:
% Done:

0%

Estimated time:

Description

unit_assign_specific_activity_target()
unit_activity_handling_targeted()
unit_activity_targeted_internal()
do_action_activity_targeted()

all use a double pointer for the extra_type structure, but only use it equivalently as a single pointer.

This patch refactors these APIs to use the more straightforward single pointer.


Files

1799.patch (13.6 KB) 1799.patch John Robertson, 12/04/2025 08:20 PM
Actions #1

Updated by John Robertson 9 days ago

Actions #2

Updated by Marko Lindqvist 9 days ago

unit_assign_specific_activity_target():

- *target = tgt;
+ target = tgt;
return;

The new assignment does nothing sensible. It just sets local variable just before the function returns. Old assignment set target on the caller side via the pointer.
...and at least action_sub_target_id_for_action() depended on that:

unit_assign_specific_activity_target(actor_unit, &activity,
- action_number(paction), &pextra);
+ action_number(paction), pextra);
if (pextra != NULL) {
Actions #3

Updated by Marko Lindqvist 9 days ago

  • Status changed from New to Rejected
  • Assignee set to Marko Lindqvist
Actions

Also available in: Atom PDF