On 5 April 2011 23:06, Marcin ?lusarz wrote:
>> +static const char *mode_status_to_string(enum drm_mode_status status)
>> +{
>> + ? ? ? const char *strings[] = {
>
> + static?
>
You'd probably even want that to be "static const char * const strings[]".
On Tue, Apr 5, 2011 at 5:41 PM, Chris Wilson
wrote:
> On Tue, 5 Apr 2011 23:39:19 +0200, Julien Cristau
> wrote:
>> On Tue, Apr ?5, 2011 at 21:50:15 +0100, Chris Wilson wrote:
>>
>> > + ? if ((unsigned)status > ARRAY_SIZE(strings))
>>
>> off by one?
>
> And didn't check for holes.
>
> /me wishe
On Tue, Apr 5, 2011 at 5:41 PM, Chris Wilson wrote:
> On Tue, 5 Apr 2011 23:39:19 +0200, Julien Cristau wrote:
>> On Tue, Apr 5, 2011 at 21:50:15 +0100, Chris Wilson wrote:
>>
>> > + if ((unsigned)status > ARRAY_SIZE(strings))
>>
>> off by one?
>
> And didn't check for holes.
>
> /me wishes he
On 5 April 2011 23:06, Marcin Ślusarz wrote:
>> +static const char *mode_status_to_string(enum drm_mode_status status)
>> +{
>> + const char *strings[] = {
>
> + static?
>
You'd probably even want that to be "static const char * const strings[]".
_
On Tue, Apr 5, 2011 at 21:50:15 +0100, Chris Wilson wrote:
> + if ((unsigned)status > ARRAY_SIZE(strings))
off by one?
> + return "unknown";
> +
> + return strings[status];
> +}
> +
Cheers,
Julien
2011/4/5 Chris Wilson :
> Signed-off-by: Chris Wilson
> ---
> ?drivers/gpu/drm/drm_modes.c | ? 52 +-
> ?1 files changed, 50 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 25bf873..b3e07ac 1006
On Tue, 5 Apr 2011 23:39:19 +0200, Julien Cristau
wrote:
> On Tue, Apr 5, 2011 at 21:50:15 +0100, Chris Wilson wrote:
>
> > + if ((unsigned)status > ARRAY_SIZE(strings))
>
> off by one?
And didn't check for holes.
/me wishes he never sent this momentarily useful bit of code. ;-)
-Chris
--
On Tue, 5 Apr 2011 23:06:19 +0200, Marcin ??lusarz wrote:
> 2011/4/5 Chris Wilson :
> > Signed-off-by: Chris Wilson
> > ---
> > ??drivers/gpu/drm/drm_modes.c | ?? 52
> > +-
> > ??1 files changed, 50 insertions(+), 2 deletions(-)
> >
> > diff --git a/driver
Signed-off-by: Chris Wilson
---
drivers/gpu/drm/drm_modes.c | 52 +-
1 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 25bf873..b3e07ac 100644
--- a/drivers/gpu/drm/drm_modes.c
On Tue, 5 Apr 2011 23:39:19 +0200, Julien Cristau wrote:
> On Tue, Apr 5, 2011 at 21:50:15 +0100, Chris Wilson wrote:
>
> > + if ((unsigned)status > ARRAY_SIZE(strings))
>
> off by one?
And didn't check for holes.
/me wishes he never sent this momentarily useful bit of code. ;-)
-Chris
--
On Tue, Apr 5, 2011 at 21:50:15 +0100, Chris Wilson wrote:
> + if ((unsigned)status > ARRAY_SIZE(strings))
off by one?
> + return "unknown";
> +
> + return strings[status];
> +}
> +
Cheers,
Julien
___
dri-devel mailing list
dri-de
On Tue, 5 Apr 2011 23:06:19 +0200, Marcin Ålusarz
wrote:
> 2011/4/5 Chris Wilson :
> > Signed-off-by: Chris Wilson
> > ---
> > Â drivers/gpu/drm/drm_modes.c | Â 52
> > +-
> > Â 1 files changed, 50 insertions(+), 2 deletions(-)
> >
> > diff --git a/drive
2011/4/5 Chris Wilson :
> Signed-off-by: Chris Wilson
> ---
> drivers/gpu/drm/drm_modes.c | 52 +-
> 1 files changed, 50 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 25bf873..b3e07ac 1006
Signed-off-by: Chris Wilson
---
drivers/gpu/drm/drm_modes.c | 52 +-
1 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 25bf873..b3e07ac 100644
--- a/drivers/gpu/drm/drm_modes.c
14 matches
Mail list logo