diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-12-21 13:21:59 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-12-21 13:21:59 +1000 |
commit | d9f02858fdc04c4404834a033850f758e4c8ee7e (patch) | |
tree | 2d7b4759cabf76eba5b7ef2147e58d3c9d7f885b /demos | |
parent | 018a930d5525ffefc30fb2514752918455853685 (diff) | |
download | uGFX-d9f02858fdc04c4404834a033850f758e4c8ee7e.tar.gz uGFX-d9f02858fdc04c4404834a033850f758e4c8ee7e.tar.bz2 uGFX-d9f02858fdc04c4404834a033850f758e4c8ee7e.zip |
Replace NULL's with 0 as NULL is not defined by the Raw32 GOS.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/benchmarks/main.c | 2 | ||||
-rw-r--r-- | demos/modules/gtimer/main.c | 4 | ||||
-rw-r--r-- | demos/modules/gwin/basic/main.c | 4 | ||||
-rw-r--r-- | demos/modules/gwin/button/main.c | 2 | ||||
-rw-r--r-- | demos/modules/gwin/checkbox/main.c | 2 | ||||
-rw-r--r-- | demos/modules/gwin/console/main.c | 6 | ||||
-rw-r--r-- | demos/modules/gwin/list/main.c | 2 | ||||
-rw-r--r-- | demos/modules/gwin/radio/main.c | 12 | ||||
-rw-r--r-- | demos/modules/gwin/slider/main.c | 4 | ||||
-rw-r--r-- | demos/modules/gwin/widgets/main.c | 58 |
10 files changed, 48 insertions, 48 deletions
diff --git a/demos/benchmarks/main.c b/demos/benchmarks/main.c index 344fd375..d8c02338 100644 --- a/demos/benchmarks/main.c +++ b/demos/benchmarks/main.c @@ -41,7 +41,7 @@ static int uitoa(unsigned int value, char * buf, int max) { int i = 0;
unsigned int tmp = 0;
- if (NULL == buf)
+ if (!buf)
return -3;
if (2 > max)
diff --git a/demos/modules/gtimer/main.c b/demos/modules/gtimer/main.c index a0ea6aee..89a6bab7 100644 --- a/demos/modules/gtimer/main.c +++ b/demos/modules/gtimer/main.c @@ -51,10 +51,10 @@ int main(void) { gtimerInit(>2);
/* continious mode - callback1() called without any argument every 250ms */
- gtimerStart(>1, callback1, NULL, TRUE, 250);
+ gtimerStart(>1, callback1, 0, TRUE, 250);
/* single shot mode - callback2() called without any argument once after 1s */
- gtimerStart(>2, callback2, NULL, FALSE, 1000);
+ gtimerStart(>2, callback2, 0, FALSE, 1000);
while(TRUE) {
gfxSleepMilliseconds(500);
diff --git a/demos/modules/gwin/basic/main.c b/demos/modules/gwin/basic/main.c index eee22f29..4d8fa33c 100644 --- a/demos/modules/gwin/basic/main.c +++ b/demos/modules/gwin/basic/main.c @@ -44,9 +44,9 @@ int main(void) { GWindowInit wi; wi.show = TRUE; wi.x = 20; wi.y = 10; wi.width = 200; wi.height = 150; - GW1 = gwinWindowCreate(NULL, &wi); + GW1 = gwinWindowCreate(0, &wi); wi.show = TRUE; wi.x = 50; wi.y = 190; wi.width = 150; wi.height = 100; - GW2 = gwinWindowCreate(NULL, &wi); + GW2 = gwinWindowCreate(0, &wi); } /* Set fore- and background colors for both windows */ diff --git a/demos/modules/gwin/button/main.c b/demos/modules/gwin/button/main.c index f210d84c..6ec8a287 100644 --- a/demos/modules/gwin/button/main.c +++ b/demos/modules/gwin/button/main.c @@ -49,7 +49,7 @@ static void createWidgets(void) { wi.text = "Push Button"; // Create the actual button - ghButton1 = gwinButtonCreate(NULL, &wi); + ghButton1 = gwinButtonCreate(0, &wi); } int main(void) { diff --git a/demos/modules/gwin/checkbox/main.c b/demos/modules/gwin/checkbox/main.c index 23d3cb17..51f96518 100644 --- a/demos/modules/gwin/checkbox/main.c +++ b/demos/modules/gwin/checkbox/main.c @@ -49,7 +49,7 @@ static void createWidgets(void) { wi.text = "Checkbox"; // Create the actual checkbox - ghCheckbox1 = gwinCheckboxCreate(NULL, &wi); + ghCheckbox1 = gwinCheckboxCreate(0, &wi); } int main(void) { diff --git a/demos/modules/gwin/console/main.c b/demos/modules/gwin/console/main.c index 0efd1c99..83753c6c 100644 --- a/demos/modules/gwin/console/main.c +++ b/demos/modules/gwin/console/main.c @@ -50,11 +50,11 @@ int main(void) { wi.show = TRUE; wi.x = 0; wi.y = 0; wi.width = gdispGetWidth(); wi.height = gdispGetHeight()/2; - GW1 = gwinConsoleCreate(NULL, &wi); + GW1 = gwinConsoleCreate(0, &wi); wi.y = gdispGetHeight()/2; wi.width = gdispGetWidth()/2; wi.height = gdispGetHeight(); - GW2 = gwinConsoleCreate(NULL, &wi); + GW2 = gwinConsoleCreate(0, &wi); wi.x = gdispGetWidth()/2; wi.height = gdispGetHeight(); - GW3 = gwinConsoleCreate(NULL, &wi); + GW3 = gwinConsoleCreate(0, &wi); } /* Use a special font for GW1 */ diff --git a/demos/modules/gwin/list/main.c b/demos/modules/gwin/list/main.c index e99c2448..03d99d58 100644 --- a/demos/modules/gwin/list/main.c +++ b/demos/modules/gwin/list/main.c @@ -49,7 +49,7 @@ static void createWidgets(void) { wi.text = "List Name"; // Create the actual list - ghList1 = gwinListCreate(NULL, &wi, FALSE); + ghList1 = gwinListCreate(0, &wi, FALSE); } int main(void) { diff --git a/demos/modules/gwin/radio/main.c b/demos/modules/gwin/radio/main.c index b7504535..9287dcf9 100644 --- a/demos/modules/gwin/radio/main.c +++ b/demos/modules/gwin/radio/main.c @@ -47,27 +47,27 @@ static void createWidgets(void) { // create Radio11 wi.g.y = 10; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 1"; - ghRadio11 = gwinRadioCreate(NULL, &wi, GROUP1); + ghRadio11 = gwinRadioCreate(0, &wi, GROUP1); // create Radio12 wi.g.y = 50; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 2"; - ghRadio12 = gwinRadioCreate(NULL, &wi, GROUP1); + ghRadio12 = gwinRadioCreate(0, &wi, GROUP1); // create Radio13 wi.g.y = 90; wi.g.x = 10; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 3"; - ghRadio13 = gwinRadioCreate(NULL, &wi, GROUP1); + ghRadio13 = gwinRadioCreate(0, &wi, GROUP1); // create Radio21 wi.g.y = 10; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 1"; - ghRadio21 = gwinRadioCreate(NULL, &wi, GROUP2); + ghRadio21 = gwinRadioCreate(0, &wi, GROUP2); // create Radio22 wi.g.y = 50; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 2"; - ghRadio22 = gwinRadioCreate(NULL, &wi, GROUP2); + ghRadio22 = gwinRadioCreate(0, &wi, GROUP2); // create Radio23 wi.g.y = 90; wi.g.x = 120; wi.g.width = 80; wi.g.height = 20; wi.text = "Radio 3"; - ghRadio23 = gwinRadioCreate(NULL, &wi, GROUP2); + ghRadio23 = gwinRadioCreate(0, &wi, GROUP2); // Check the first radio buttons gwinRadioPress(ghRadio11); diff --git a/demos/modules/gwin/slider/main.c b/demos/modules/gwin/slider/main.c index ed936f12..6e72b447 100644 --- a/demos/modules/gwin/slider/main.c +++ b/demos/modules/gwin/slider/main.c @@ -43,11 +43,11 @@ static void createWidgets(void) { // create Slider1 wi.g.y = 10; wi.g.x = 10; wi.g.width = 200; wi.g.height = 20; wi.text = "S1"; - ghSlider1 = gwinSliderCreate(NULL, &wi); + ghSlider1 = gwinSliderCreate(0, &wi); // create Slider2 wi.g.y = 40; wi.g.x = 10; wi.g.width = 20; wi.g.height = 200; wi.text = "S2"; - ghSlider2 = gwinSliderCreate(NULL, &wi); + ghSlider2 = gwinSliderCreate(0, &wi); } int main(void) { diff --git a/demos/modules/gwin/widgets/main.c b/demos/modules/gwin/widgets/main.c index a6d398aa..af2926d7 100644 --- a/demos/modules/gwin/widgets/main.c +++ b/demos/modules/gwin/widgets/main.c @@ -114,58 +114,58 @@ static void createWidgets(void) { // Create the Tabs wi.g.show = TRUE; wi.customDraw = gwinRadioDraw_Tab; wi.g.width = ScrWidth/7; wi.g.height = TAB_HEIGHT; wi.g.y = 0; - wi.g.x = 0*wi.g.width; wi.text = "Buttons"; ghTabButtons = gwinRadioCreate(NULL, &wi, GROUP_TABS); - wi.g.x = 1*wi.g.width; wi.text = "Sliders"; ghTabSliders = gwinRadioCreate(NULL, &wi, GROUP_TABS); - wi.g.x = 2*wi.g.width; wi.text = "Checkbox"; ghTabCheckboxes = gwinRadioCreate(NULL, &wi, GROUP_TABS); - wi.g.x = 3*wi.g.width; wi.text = "Radios"; ghTabRadios = gwinRadioCreate(NULL, &wi, GROUP_TABS); - wi.g.x = 4*wi.g.width; wi.text = "Lists"; ghTabLists = gwinRadioCreate(NULL, &wi, GROUP_TABS); - wi.g.x = 5*wi.g.width; wi.text = "Labels"; ghTabLabels = gwinRadioCreate(NULL, &wi, GROUP_TABS); - wi.g.x = 6*wi.g.width; wi.text = "Images"; ghTabImages = gwinRadioCreate(NULL, &wi, GROUP_TABS); + wi.g.x = 0*wi.g.width; wi.text = "Buttons"; ghTabButtons = gwinRadioCreate(0, &wi, GROUP_TABS); + wi.g.x = 1*wi.g.width; wi.text = "Sliders"; ghTabSliders = gwinRadioCreate(0, &wi, GROUP_TABS); + wi.g.x = 2*wi.g.width; wi.text = "Checkbox"; ghTabCheckboxes = gwinRadioCreate(0, &wi, GROUP_TABS); + wi.g.x = 3*wi.g.width; wi.text = "Radios"; ghTabRadios = gwinRadioCreate(0, &wi, GROUP_TABS); + wi.g.x = 4*wi.g.width; wi.text = "Lists"; ghTabLists = gwinRadioCreate(0, &wi, GROUP_TABS); + wi.g.x = 5*wi.g.width; wi.text = "Labels"; ghTabLabels = gwinRadioCreate(0, &wi, GROUP_TABS); + wi.g.x = 6*wi.g.width; wi.text = "Images"; ghTabImages = gwinRadioCreate(0, &wi, GROUP_TABS); // Buttons wi.g.show = FALSE; wi.customDraw = 0; wi.g.width = BUTTON_WIDTH; wi.g.height = BUTTON_HEIGHT; wi.g.y = TAB_HEIGHT+5; - wi.g.x = 0+0*(BUTTON_WIDTH+1); wi.text = "B1"; ghButton1 = gwinButtonCreate(NULL, &wi); - wi.g.x = 0+1*(BUTTON_WIDTH+1); wi.text = "B2"; ghButton2 = gwinButtonCreate(NULL, &wi); - wi.g.x = 0+2*(BUTTON_WIDTH+1); wi.text = "B3"; ghButton3 = gwinButtonCreate(NULL, &wi); - wi.g.x = 0+3*(BUTTON_WIDTH+1); wi.text = "B4"; ghButton4 = gwinButtonCreate(NULL, &wi); + wi.g.x = 0+0*(BUTTON_WIDTH+1); wi.text = "B1"; ghButton1 = gwinButtonCreate(0, &wi); + wi.g.x = 0+1*(BUTTON_WIDTH+1); wi.text = "B2"; ghButton2 = gwinButtonCreate(0, &wi); + wi.g.x = 0+2*(BUTTON_WIDTH+1); wi.text = "B3"; ghButton3 = gwinButtonCreate(0, &wi); + wi.g.x = 0+3*(BUTTON_WIDTH+1); wi.text = "B4"; ghButton4 = gwinButtonCreate(0, &wi); // Horizontal Sliders wi.g.width = ScrWidth/2-2; wi.g.height = SLIDER_WIDTH; wi.g.x = ScrWidth/2+1; - wi.g.y = ScrHeight/2-2*(SLIDER_WIDTH+1); wi.text = "S1"; ghSlider1 = gwinSliderCreate(NULL, &wi); - wi.g.y = ScrHeight/2-1*(SLIDER_WIDTH+1); wi.text = "S2"; ghSlider2 = gwinSliderCreate(NULL, &wi); + wi.g.y = ScrHeight/2-2*(SLIDER_WIDTH+1); wi.text = "S1"; ghSlider1 = gwinSliderCreate(0, &wi); + wi.g.y = ScrHeight/2-1*(SLIDER_WIDTH+1); wi.text = "S2"; ghSlider2 = gwinSliderCreate(0, &wi); // Vertical Sliders wi.g.width = SLIDER_WIDTH; wi.g.height = ScrHeight/2-2; wi.g.y = ScrHeight/2+1; - wi.g.x = 0+0*(SLIDER_WIDTH+1); wi.text = "S3"; ghSlider3 = gwinSliderCreate(NULL, &wi); - wi.g.x = 0+1*(SLIDER_WIDTH+1); wi.text = "S4"; ghSlider4 = gwinSliderCreate(NULL, &wi); + wi.g.x = 0+0*(SLIDER_WIDTH+1); wi.text = "S3"; ghSlider3 = gwinSliderCreate(0, &wi); + wi.g.x = 0+1*(SLIDER_WIDTH+1); wi.text = "S4"; ghSlider4 = gwinSliderCreate(0, &wi); // Checkboxes - for the 2nd checkbox we apply special drawing before making it visible wi.g.width = CHECKBOX_WIDTH; wi.g.height = CHECKBOX_HEIGHT; wi.g.x = 0; - wi.g.y = TAB_HEIGHT+5+0*(CHECKBOX_HEIGHT+1); wi.text = "C1"; ghCheckbox1 = gwinCheckboxCreate(NULL, &wi); + wi.g.y = TAB_HEIGHT+5+0*(CHECKBOX_HEIGHT+1); wi.text = "C1"; ghCheckbox1 = gwinCheckboxCreate(0, &wi); wi.customDraw = gwinCheckboxDraw_CheckOnRight; - wi.g.y = TAB_HEIGHT+5+1*(CHECKBOX_HEIGHT+1); wi.text = "C2"; ghCheckbox2 = gwinCheckboxCreate(NULL, &wi); + wi.g.y = TAB_HEIGHT+5+1*(CHECKBOX_HEIGHT+1); wi.text = "C2"; ghCheckbox2 = gwinCheckboxCreate(0, &wi); wi.customDraw = 0; wi.g.width = DISABLEALL_WIDTH; - wi.g.y = TAB_HEIGHT+5+2*(CHECKBOX_HEIGHT+1); wi.text = "Disable All"; ghCheckDisableAll = gwinCheckboxCreate(NULL, &wi); + wi.g.y = TAB_HEIGHT+5+2*(CHECKBOX_HEIGHT+1); wi.text = "Disable All"; ghCheckDisableAll = gwinCheckboxCreate(0, &wi); // Labels wi.g.width = 0; wi.g.height = LABEL_HEIGHT; // dynamic width, fixed height - wi.g.y = TAB_HEIGHT+5+2*(CHECKBOX_HEIGHT+1); wi.text = "Label"; ghLabel1 = gwinLabelCreate(NULL, &wi); + wi.g.y = TAB_HEIGHT+5+2*(CHECKBOX_HEIGHT+1); wi.text = "Label"; ghLabel1 = gwinLabelCreate(0, &wi); // Radio Buttons wi.g.width = RADIO_WIDTH; wi.g.height = RADIO_HEIGHT; wi.g.y = TAB_HEIGHT+5; - wi.g.x = 0*wi.g.width; wi.text = "Yes"; ghRadio1 = gwinRadioCreate(NULL, &wi, GROUP_YESNO); - wi.g.x = 1*wi.g.width; wi.text = "No"; ghRadio2 = gwinRadioCreate(NULL, &wi, GROUP_YESNO); + wi.g.x = 0*wi.g.width; wi.text = "Yes"; ghRadio1 = gwinRadioCreate(0, &wi, GROUP_YESNO); + wi.g.x = 1*wi.g.width; wi.text = "No"; ghRadio2 = gwinRadioCreate(0, &wi, GROUP_YESNO); wi.g.width = COLOR_WIDTH; wi.g.y += RADIO_HEIGHT+5; - wi.g.x = 0*wi.g.width; wi.text = "Black"; ghRadioBlack = gwinRadioCreate(NULL, &wi, GROUP_COLORS); - wi.g.x = 1*wi.g.width; wi.text = "White"; ghRadioWhite = gwinRadioCreate(NULL, &wi, GROUP_COLORS); - wi.g.x = 2*wi.g.width; wi.text = "Yellow"; ghRadioYellow = gwinRadioCreate(NULL, &wi, GROUP_COLORS); + wi.g.x = 0*wi.g.width; wi.text = "Black"; ghRadioBlack = gwinRadioCreate(0, &wi, GROUP_COLORS); + wi.g.x = 1*wi.g.width; wi.text = "White"; ghRadioWhite = gwinRadioCreate(0, &wi, GROUP_COLORS); + wi.g.x = 2*wi.g.width; wi.text = "Yellow"; ghRadioYellow = gwinRadioCreate(0, &wi, GROUP_COLORS); gwinRadioPress(ghRadioWhite); // Lists wi.g.show = FALSE; wi.customDraw = 0; wi.g.width = LIST_WIDTH; wi.g.height = LIST_HEIGHT; wi.g.y = TAB_HEIGHT+5; - wi.g.x = 0+0*(LIST_WIDTH+1); wi.text = "L1"; ghList1 = gwinListCreate(NULL, &wi, FALSE); + wi.g.x = 0+0*(LIST_WIDTH+1); wi.text = "L1"; ghList1 = gwinListCreate(0, &wi, FALSE); gwinListAddItem(ghList1, "Item 0", FALSE); gwinListAddItem(ghList1, "Item 1", FALSE); gwinListAddItem(ghList1, "Item 2", FALSE); gwinListAddItem(ghList1, "Item 3", FALSE); gwinListAddItem(ghList1, "Item 4", FALSE); gwinListAddItem(ghList1, "Item 5", FALSE); @@ -173,7 +173,7 @@ static void createWidgets(void) { gwinListAddItem(ghList1, "Item 8", FALSE); gwinListAddItem(ghList1, "Item 9", FALSE); gwinListAddItem(ghList1, "Item 10", FALSE); gwinListAddItem(ghList1, "Item 11", FALSE); gwinListAddItem(ghList1, "Item 12", FALSE); gwinListAddItem(ghList1, "Item 13", FALSE); - wi.g.x = 0+1*(LIST_WIDTH+1); wi.text = "L2"; ghList2 = gwinListCreate(NULL, &wi, TRUE); + wi.g.x = 0+1*(LIST_WIDTH+1); wi.text = "L2"; ghList2 = gwinListCreate(0, &wi, TRUE); gwinListAddItem(ghList2, "Item 0", FALSE); gwinListAddItem(ghList2, "Item 1", FALSE); gwinListAddItem(ghList2, "Item 2", FALSE); gwinListAddItem(ghList2, "Item 3", FALSE); gwinListAddItem(ghList2, "Item 4", FALSE); gwinListAddItem(ghList2, "Item 5", FALSE); @@ -181,7 +181,7 @@ static void createWidgets(void) { gwinListAddItem(ghList2, "Item 8", FALSE); gwinListAddItem(ghList2, "Item 9", FALSE); gwinListAddItem(ghList2, "Item 10", FALSE); gwinListAddItem(ghList2, "Item 11", FALSE); gwinListAddItem(ghList2, "Item 12", FALSE); gwinListAddItem(ghList2, "Item 13", FALSE); - wi.g.x = 0+2*(LIST_WIDTH+1); wi.text = "L3"; ghList3 = gwinListCreate(NULL, &wi, TRUE); + wi.g.x = 0+2*(LIST_WIDTH+1); wi.text = "L3"; ghList3 = gwinListCreate(0, &wi, TRUE); gwinListAddItem(ghList3, "Item 0", FALSE); gwinListAddItem(ghList3, "Item 1", FALSE); gwinListAddItem(ghList3, "Item 2", FALSE); gwinListAddItem(ghList3, "Item 3", FALSE); gdispImageSetMemoryReader(&imgYesNo, image_yesno); @@ -191,14 +191,14 @@ static void createWidgets(void) { // Image wi.g.x = ScrWidth-210; wi.g.y = TAB_HEIGHT + 10; wi.g.width = 200; wi.g.height = 200; - ghImage1 = gwinImageCreate(NULL, &wi.g); + ghImage1 = gwinImageCreate(0, &wi.g); gwinImageOpenMemory(ghImage1, image_chibios); gwinImageCache(ghImage1); // Console - we apply some special colors before making it visible wi.g.width = ScrWidth/2-1; wi.g.height = ScrHeight/2-1; wi.g.x = ScrWidth/2+1; wi.g.y = ScrHeight/2+1; - ghConsole = gwinConsoleCreate(NULL, &wi.g); + ghConsole = gwinConsoleCreate(0, &wi.g); gwinSetColor(ghConsole, Yellow); gwinSetBgColor(ghConsole, Black); } |