Rewrite NR_MAC UE_iterator() to limit variable scope
Especially in pf_dl()/pf_ul(), we use a first loop using UE_iterator(), then iterate over a subset of UEs. It has happened a couple of times that I was using variable "UE" (from the iterator), when it should only be used in the first UE_iterator() loop. Rewrite UE_iterator() to effectively limit the scope of the iterator variables to the body of the UE_iterator. This should also make it possible to reuse multiple UE_iterator()s with the same variables in sequence.
This commit is contained in:
@@ -819,7 +819,7 @@ typedef struct {
|
||||
nr_beam_mode_t beam_mode;
|
||||
} NR_beam_info_t;
|
||||
|
||||
#define UE_iterator(BaSe, VaR) NR_UE_info_t ** VaR##pptr=BaSe, *VaR; while ((VaR=*(VaR##pptr++)))
|
||||
#define UE_iterator(BaSe, VaR) for (NR_UE_info_t **VaR##pptr=BaSe, *VaR=*VaR##pptr; VaR; VaR=*(++VaR##pptr))
|
||||
|
||||
typedef struct {
|
||||
/// current frame for DCI
|
||||
|
||||
Reference in New Issue
Block a user