* [PATCH] osm_subnet.c change void* arithmetic to char*
@ 2009-10-01 21:38 Smith, Stan
[not found] ` <3F6F638B8D880340AB536D29CD4C1E1912C86E8A99-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Smith, Stan @ 2009-10-01 21:38 UTC (permalink / raw)
To: Sasha Khapyorsky
Cc: ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org, linux-rdma
MS compiler doesn't Grok void* arithmetic, use char*
Signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--- a/opensm/opensm/osm_subnet.c 2009-10-01 12:45:52.000000000 -0700
+++ b/opensm/opensm/osm_subnet.c 2009-10-01 14:24:18.000000000 -0700
@@ -1193,8 +1193,8 @@
if (strcmp(r->name, p_key))
continue;
- p_field1 = (void *)p_opts->file_opts + r->opt_offset;
- p_field2 = (void *)p_opts + r->opt_offset;
+ p_field1 = (char *)p_opts->file_opts + r->opt_offset;
+ p_field2 = (char *)p_opts + r->opt_offset;
/* don't call setup function first time */
r->parse_fn(NULL, p_key, p_val, p_field1, p_field2,
NULL);
@@ -1253,8 +1253,8 @@
if (!r->can_update || strcmp(r->name, p_key))
continue;
- p_field1 = (void *)p_opts->file_opts + r->opt_offset;
- p_field2 = (void *)p_opts + r->opt_offset;
+ p_field1 = (char *)p_opts->file_opts + r->opt_offset;
+ p_field2 = (char *)p_opts + r->opt_offset;
r->parse_fn(p_subn, p_key, p_val, p_field1, p_field2,
r->setup_fn);
break;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] osm_subnet.c change void* arithmetic to char*
[not found] ` <3F6F638B8D880340AB536D29CD4C1E1912C86E8A99-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2009-10-01 22:28 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2009-10-01 22:28 UTC (permalink / raw)
To: Smith, Stan
Cc: Sasha Khapyorsky,
ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org, linux-rdma
On Thu, Oct 01, 2009 at 02:38:28PM -0700, Smith, Stan wrote:
>
> MS compiler doesn't Grok void* arithmetic, use char*
uint8_t* or unsigned char is better practice here, char could be wchar
in some crazy instances..
Probably should build with -Wpointer-arith on Linux.
Regards,
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-01 22:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01 21:38 [PATCH] osm_subnet.c change void* arithmetic to char* Smith, Stan
[not found] ` <3F6F638B8D880340AB536D29CD4C1E1912C86E8A99-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2009-10-01 22:28 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox