Thread (5 messages) 5 messages, 2 authors, 2013-12-16

Re: [PATCH 2/2] Input: joystick - use sizeof(VARIABLE) in documentation

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2013-12-16 09:51:49

Hi Antonio,

On Mon, Dec 16, 2013 at 09:57:15AM +0100, Antonio Ospite wrote:
quoted hunk ↗ jump to hunk
@@ -181,7 +181,7 @@ at a time using the typical read(2) functionality. For that, you would
 replace the read above with something like
 
 	struct js_event mybuffer[0xff];
-	int i = read (fd, mybuffer, sizeof(struct mybuffer));
+	int i = read (fd, mybuffer, ARRAY_SIZE(mybuffer));
 
This is wrong, as ARRAY_SIZE(mybuffer) would be 0xff and not the size of
buffer in bytes. I'll fix it up.

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help