Skip to contentSkip to conversation

package/sp-oops-extract: consolidate use of stdint types

PATCH New Doug Kehn 3 participants 3 messages Jan 4, 2016 – Jan 5, 2016

lore
Share & tools
lore

Doug Kehn

author
#0 lore raw

PATCH v2 1/1 package/sp-oops-extract: consolidate use of stdint types

Change u_int*_t to uint*_t for compatibility with a larger number of C libraries.

Fixes:
http://autobuild.buildroot.net/results/c649822aa129d56e5462a4887b13811340564453/

This patch has also been submitted upstream (ptxdist at pengutronix.de).

Cc Luca Ceresoli <[email protected]>

---
Changes v1 -> v2
- add auto-build link (suggested by Luca)

 package/sp-oops-extract/0002-stdint-cleanup.patch | 33 +++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 package/sp-oops-extract/0002-stdint-cleanup.patch
package/sp-oops-extract/0002-stdint-cleanup.patch new file +33 -0
new file mode 100644
index 0000000..255fe8a
@@ -0,0 +1,33 @@
+consolidate use of stdint types
+
+Change u_int*_t to uint*_t for compatibility with a larger number of C
+libraries.
+
+Signed-off-by: Doug Kehn <[email protected]>
+
+Index: sp-oops-extract-0.0.7-1/src/oopslog.c
+===================================================================
+--- sp-oops-extract-0.0.7-1.orig/src/oopslog.c
++++ sp-oops-extract-0.0.7-1/src/oopslog.c
+@@ -64,8 +64,8 @@ static int try_to_check_for_bad_blocks(v
+ 
+ int main(const int argc, const char *argv[])
+ {
+-	u_int32_t *count, maxcount = 0xffffffff;
+-	u_int32_t *magic_ptr, magic_value = 0x5d005d00;
++	uint32_t *count, maxcount = 0xffffffff;
++	uint32_t *magic_ptr, magic_value = 0x5d005d00;
+ 	
+ 	unsigned char *charbuf;
+ 	unsigned long size;
+@@ -137,8 +137,8 @@ int main(const int argc, const char *arg
+ 		errx(-1, "%s is something weird", device);
+ 
+ 	charbuf = buf;	
+-	count = (u_int32_t *) buf;
+-	magic_ptr = (u_int32_t *) (buf + sizeof(u_int32_t));
++	count = (uint32_t *) buf;
++	magic_ptr = (uint32_t *) (buf + sizeof(uint32_t));
+ 
+ 	for (i = 0; i < (size / OOPS_PAGE_SIZE); i++) {
+ 		pread(fd, buf, OOPS_PAGE_SIZE, i * OOPS_PAGE_SIZE);
Signature · 1 line
2.6.4
#1 lore raw

PATCH v2 1/1 package/sp-oops-extract: consolidate use of stdint types

Quoted 10 lines · Doug Kehn

Change u_int*_t to uint*_t for compatibility with a larger number of C libraries.

Fixes:
http://autobuild.buildroot.net/results/c649822aa129d56e5462a4887b13811340564453/

This patch has also been submitted upstream (ptxdist at pengutronix.de).

Cc Luca Ceresoli <[email protected]>

Regards,
Arnout

Quoted 48 lines

---
Changes v1 -> v2
- add auto-build link (suggested by Luca)

 package/sp-oops-extract/0002-stdint-cleanup.patch | 33 +++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 package/sp-oops-extract/0002-stdint-cleanup.patch
package/sp-oops-extract/0002-stdint-cleanup.patch new file +33 -0
new file mode 100644
index 0000000..255fe8a
@@ -0,0 +1,33 @@
+consolidate use of stdint types
+
+Change u_int*_t to uint*_t for compatibility with a larger number of C
+libraries.
+
+Signed-off-by: Doug Kehn <[email protected]>
+
+Index: sp-oops-extract-0.0.7-1/src/oopslog.c
+===================================================================
+--- sp-oops-extract-0.0.7-1.orig/src/oopslog.c
++++ sp-oops-extract-0.0.7-1/src/oopslog.c
+@@ -64,8 +64,8 @@ static int try_to_check_for_bad_blocks(v
+ 
+ int main(const int argc, const char *argv[])
+ {
+-	u_int32_t *count, maxcount = 0xffffffff;
+-	u_int32_t *magic_ptr, magic_value = 0x5d005d00;
++	uint32_t *count, maxcount = 0xffffffff;
++	uint32_t *magic_ptr, magic_value = 0x5d005d00;
+ 	
+ 	unsigned char *charbuf;
+ 	unsigned long size;
+@@ -137,8 +137,8 @@ int main(const int argc, const char *arg
+ 		errx(-1, "%s is something weird", device);
+ 
+ 	charbuf = buf;	
+-	count = (u_int32_t *) buf;
+-	magic_ptr = (u_int32_t *) (buf + sizeof(u_int32_t));
++	count = (uint32_t *) buf;
++	magic_ptr = (uint32_t *) (buf + sizeof(uint32_t));
+ 
+ 	for (i = 0; i < (size / OOPS_PAGE_SIZE); i++) {
+ 		pread(fd, buf, OOPS_PAGE_SIZE, i * OOPS_PAGE_SIZE);
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH v2 1/1 package/sp-oops-extract: consolidate use of stdint types

In reply to Doug Kehn
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Doug" == Doug Kehn <[email protected]> writes:

Change u_int*_t to uint*_t for compatibility with a larger number of C libraries.

Fixes:
http://autobuild.buildroot.net/results/c649822aa129d56e5462a4887b13811340564453/

This patch has also been submitted upstream (ptxdist at pengutronix.de).

It is more about toolchains that C libraries as uint*_t is in C99, and u_int*_t isn't - E.G.:

https://stackoverflow.com/questions/5090737/datatypes-used-in-c

Committed with the description extended a bit to explain this, thanks.

Signature · 1 line
Bye, Peter Korsgaard