Mir

Merge lp:~robertcarr/mir/display-sizes-are-unsigned into lp:~mir-team/mir/trunk

Proposed by Robert Carr
Status: Merged
Approved by: Robert Ancell
Approved revision: no longer in the source branch.
Merged at revision: 724
Proposed branch: lp:~robertcarr/mir/display-sizes-are-unsigned
Merge into: lp:~mir-team/mir/trunk
Diff against target: 117 lines (+13/-10)
8 files modified
examples/eglapp.c (+1/-1)
examples/eglapp.h (+1/-1)
examples/eglflash.c (+1/-1)
examples/eglplasma.c (+1/-1)
examples/egltriangle.c (+1/-1)
include/shared/mir_toolkit/client_types.h (+5/-2)
src/shared/protobuf/mir_protobuf.proto (+2/-2)
tests/acceptance-tests/test_client_library.cpp (+1/-1)
To merge this branch: bzr merge lp:~robertcarr/mir/display-sizes-are-unsigned
Reviewer Review Type Date Requested Status
Robert Ancell Approve
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Approve
Review via email: mp+167809@code.launchpad.net

Commit message

Change client library display sizes to unsigned.

Description of the change

Noticed in platform-api mirclient that an ugly cast had to be made!

Changed client library display sizes to unsigned. I think uint32_t should be enough ;)

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

LGTM

But maybe we need a team discussion about when to use signed vs unsigned types

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/eglapp.c'
2--- examples/eglapp.c 2013-05-02 00:11:18 +0000
3+++ examples/eglapp.c 2013-06-06 16:46:32 +0000
4@@ -111,7 +111,7 @@
5 }
6 }
7
8-mir_eglapp_bool mir_eglapp_init(int *width, int *height)
9+mir_eglapp_bool mir_eglapp_init(unsigned int *width, unsigned int *height)
10 {
11 EGLint ctxattribs[] =
12 {
13
14=== modified file 'examples/eglapp.h'
15--- examples/eglapp.h 2013-03-08 07:48:28 +0000
16+++ examples/eglapp.h 2013-06-06 16:46:32 +0000
17@@ -25,7 +25,7 @@
18
19 typedef int mir_eglapp_bool;
20
21-mir_eglapp_bool mir_eglapp_init(int *width, int *height);
22+mir_eglapp_bool mir_eglapp_init(unsigned int *width, unsigned int *height);
23 void mir_eglapp_swap_buffers(void);
24 mir_eglapp_bool mir_eglapp_running(void);
25 void mir_eglapp_shutdown(void);
26
27=== modified file 'examples/eglflash.c'
28--- examples/eglflash.c 2013-03-08 09:13:54 +0000
29+++ examples/eglflash.c 2013-06-06 16:46:32 +0000
30@@ -25,7 +25,7 @@
31
32 int main(void)
33 {
34- int width = 0, height = 0; /* Use the full display */
35+ unsigned int width = 0, height = 0;
36
37 if (!mir_eglapp_init(&width, &height))
38 {
39
40=== modified file 'examples/eglplasma.c'
41--- examples/eglplasma.c 2013-04-24 05:22:20 +0000
42+++ examples/eglplasma.c 2013-06-06 16:46:32 +0000
43@@ -107,7 +107,7 @@
44 };
45 GLuint vshader, fshader, prog;
46 GLint linked, low_color, high_color, vpos, theta;
47- int width = 0, height = 0;
48+ unsigned int width = 0, height = 0;
49 GLfloat angle = 0.0f;
50
51 if (!mir_eglapp_init(&width, &height))
52
53=== modified file 'examples/egltriangle.c'
54--- examples/egltriangle.c 2013-03-08 09:13:54 +0000
55+++ examples/egltriangle.c 2013-06-06 16:46:32 +0000
56@@ -79,7 +79,7 @@
57 };
58 GLuint vshader, fshader, prog;
59 GLint linked, col, vpos, theta;
60- int width = 512, height = 512;
61+ unsigned int width = 512, height = 512;
62 GLfloat angle = 0.0f;
63
64 if (!mir_eglapp_init(&width, &height))
65
66=== modified file 'include/shared/mir_toolkit/client_types.h'
67--- include/shared/mir_toolkit/client_types.h 2013-06-06 08:36:17 +0000
68+++ include/shared/mir_toolkit/client_types.h 2013-06-06 16:46:32 +0000
69@@ -23,6 +23,8 @@
70
71 #include <mir_toolkit/event.h>
72
73+#include <stddef.h>
74+
75 #ifdef __cplusplus
76 /**
77 * \defgroup mir_toolkit MIR graphics tools API
78@@ -158,8 +160,9 @@
79 */
80 typedef struct MirDisplayInfo
81 {
82- int width;
83- int height;
84+ uint32_t width;
85+ uint32_t height;
86+
87 int supported_pixel_format_items;
88 MirPixelFormat supported_pixel_format[mir_supported_pixel_format_max];
89 } MirDisplayInfo;
90
91=== modified file 'src/shared/protobuf/mir_protobuf.proto'
92--- src/shared/protobuf/mir_protobuf.proto 2013-05-30 03:50:54 +0000
93+++ src/shared/protobuf/mir_protobuf.proto 2013-06-06 16:46:32 +0000
94@@ -49,8 +49,8 @@
95 // attributes or, in the case of an error, the error attribute. So the
96 // attributes are all "optional" (or "repeated").
97 message DisplayInfo {
98- required int32 width = 1;
99- required int32 height = 2;
100+ required uint32 width = 1;
101+ required uint32 height = 2;
102 repeated uint32 supported_pixel_format = 3;
103 }
104
105
106=== modified file 'tests/acceptance-tests/test_client_library.cpp'
107--- tests/acceptance-tests/test_client_library.cpp 2013-06-06 08:36:17 +0000
108+++ tests/acceptance-tests/test_client_library.cpp 2013-06-06 16:46:32 +0000
109@@ -627,7 +627,7 @@
110
111 TEST_F(DefaultDisplayServerTestFixture, client_library_accesses_display_info)
112 {
113- static const int default_display_width = 1600, default_display_height = 1600;
114+ static const unsigned int default_display_width = 1600, default_display_height = 1600;
115
116 struct ClientConfig : ClientConfigCommon
117 {

Subscribers

People subscribed via source and target branches