Introduced "const" attribute to libs/bit_frames.c #3

Merged
merged 1 commit into from Dec 26, 2012

Projects

None yet

3 participants

@smoe
Contributor
smoe commented Dec 25, 2012

Dear Wolfgang,

This patch shall help lay out a format that indicates
if a variable is changed within a function or not. I am aware of a general reluctance to add the const flag to mere integers. Also, there is no standardised way to indicate any argument as "not const", which however is of uttermost importance to anyone learning about the code in my perception.

Kind regards,

Steffen

@smoe smoe Introduced "const" attribute to libs/bit_frames.c
This patch shall help lay out a format that indicates
if a variable is changed within a function or not.
17352fb
@minux minux commented on the diff Dec 26, 2012
libs/bit_frames.c
@@ -9,7 +9,8 @@
#include "bit.h"
#include "control.h"
-static uint8_t* get_first_minor(struct fpga_bits* bits, int row, int major)
+static uint8_t* get_first_minor(struct fpga_bits* const bits,
@minux
minux Dec 26, 2012 Contributor

in fact, i think the first argument should be typed "const struct fpag_bits *const bits"
for maximum const correctness.

@xiangfu xiangfu merged commit 508f13b into Wolfgang-Spraul:master Dec 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment