back at the naming bikeshed

[email protected]
Newsgroups org.kernelnewbies.kernelnewbies
Message-ID <CAJfuBxww7VOUhwoz4KdxpaRQOkfjr11M5CbxAoRzf-ZNu4uHdQ@mail.gmail.com>
so I found myself writing this macro, and using it 4 times.

+#define for_each_boxed_veclen(_box, _vec, _len, _ct, _curs) \
+ for (_ct = 0, _curs = _box->_vec; _ct < _box->_len; _ct++, _curs++)

- for (i = 0, cm = di->classes; i < di->num_classes; i++, cm++) {
+ for_each_boxed_veclen(di, classes, num_classes, i, cm) {

Qs:

does it exist by another name already ?

is it worth having generally ?

are there better ways to do it ?

fwiw, it does sound semantically connected to __counted_by()  attribute

struct Ntuple {
  int len;
  struct tuple **vector __counted_by(len);
}

_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.