osmo-pcu[master]: Use built-in bit counter

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Fri Jan 26 17:52:44 UTC 2018


Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/6104/1/src/pcu_utils.h
File src/pcu_utils.h:

Line 40: 	return __builtin_popcount(x);
__builtin_popcount only works for unsigned int according to https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html, so having this inside a templated function is a really bad idea. If we want to use this pcu_bitcound for several different types which cannot be transformed to unsigned int, then it's wrong. If in the end we only use it for unsigned int types, then we should drop the templated function and use this bult function directly.


-- 
To view, visit https://gerrit.osmocom.org/6104
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaf470e9a7ee0d003177c4328f93849606ca31521
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list