Rosen Penev <[email protected]> writes:
>> On Jul 17, 2020, at 3:06 AM, Felix Fietkau <[email protected]> wrote:
>>> +--- a/ui_common.h
>>> ++++ b/ui_common.h
>>> +@@ -33,12 +33,12 @@ typedef struct host_pair_line_tag {
>>> +
>>> + extern options_t options;
>>> +
>>> +-sorted_list_type screen_list;
>>> +-host_pair_line totals;
>>> +-int peaksent, peakrecv, peaktotal;
>>> ++static sorted_list_type screen_list;
>>> ++static host_pair_line totals;
>>> ++static int peaksent, peakrecv, peaktotal;
>>> + extern history_type history_totals;
>>> +-hash_type* screen_hash;
>>> +-hash_type* service_hash;
>>> ++static hash_type* screen_hash;
>>> ++static hash_type* service_hash;
>>
>> Declaring these variables as static in a header file seems wrong to me.
>> Shouldn't this be declared as a global variable in one of the .c files
>> and extern here?
>
> Sure. static creates a smaller patch though.
How does that help if the result is buggy? I assume these variables are
declared in a header because their values are actually shared.
Bjørn
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel