libosmocore[master]: utils/conv_gen.py: improve output formatting

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Oct 17 23:31:27 UTC 2016


Patch Set 6:

(6 comments)

https://gerrit.osmocom.org/#/c/829/6/utils/conv_gen.py
File utils/conv_gen.py:

Line 142: 			if counter == 0:
counter == 0 will only happen at the very first iteration, so you can put the fi.write('\t') above the for loop (assuming that num_states is never empty).


Line 164: 			if counter == 0:
same


Line 179: 			if counter == 0:
same


Line 185: 			counter += 1
Actually, the output loop with the 'counter % 12' algorithm and whitespace is duplicated like three times. Can't this be handled by one central function to undup?

E.g. each caller composes a list of items that is then passed to one formatting function.


Line 212: 		# Write puncture if preset
'present'? Actually I think this comment states the obvious.


Line 214: 			print >>fi, "\nstatic const int %s_puncture[] = {" % self.name
interesting, never saw this 'print >>fi' syntax before


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I95256c4ad402a3c088bdb6c5a5cda8b17c31881c
Gerrit-PatchSet: 6
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list