Index: branches/azimutz/Chazileon/i386/libsaio/saio_types.h =================================================================== --- branches/azimutz/Chazileon/i386/libsaio/saio_types.h (revision 456) +++ branches/azimutz/Chazileon/i386/libsaio/saio_types.h (revision 457) @@ -232,13 +232,13 @@ DEV_EN = 3 }; -#ifndef max +//#ifndef max #define max(a,b) ((a) > (b) ? (a) : (b)) -#endif +//#endif -#ifndef min +//#ifndef min #define min(a,b) ((a) < (b) ? (a) : (b)) -#endif +//#endif #define round2(x, m) (((x) + (m / 2)) & ~(m - 1)) #define roundup2(x, m) (((x) + m - 1) & ~(m - 1)) Index: branches/azimutz/Chazileon/i386/boot2/graphics.c =================================================================== --- branches/azimutz/Chazileon/i386/boot2/graphics.c (revision 456) +++ branches/azimutz/Chazileon/i386/boot2/graphics.c (revision 457) @@ -44,7 +44,7 @@ #define VIDEO(x) (bootArgs->Video.v_ ## x) -//#define min(x, y) ((x) < (y) ? (x) : (y)) Azi: it's defined on saio_types.h +//#define min(x, y) ((x) < (y) ? (x) : (y)) Azi: defined on saio_types.h //========================================================================== // getVBEInfoString Index: branches/azimutz/Chazileon/i386/boot2/gui.c =================================================================== --- branches/azimutz/Chazileon/i386/boot2/gui.c (revision 456) +++ branches/azimutz/Chazileon/i386/boot2/gui.c (revision 457) @@ -15,8 +15,8 @@ #include "edid.h" //Azi:autoresolution #include "autoresolution.h" -//#define min(x, y) ((x) < (y) ? (x) : (y)) Azi: it's defined on saio_types.h -//#define max(x, y) ((x) > (y) ? (x) : (y)) || || +//#define min(x, y) ((x) < (y) ? (x) : (y)) Azi: defined on saio_types.h +//#define max(x, y) ((x) > (y) ? (x) : (y)) || || #define VIDEO(x) (bootArgs->Video.v_ ## x) @@ -761,12 +761,12 @@ if (createWindowBuffer(&gui.bootprompt) == 0) { if (createWindowBuffer(&gui.infobox) == 0) { if (createWindowBuffer(&gui.menu) == 0) { - gui.logo.draw = true; #ifdef AUTORES_DEBUG printf("Press Any Key...\n"); getc(); #endif + gui.logo.draw = true; drawBackground(); // lets copy the screen into the back buffer memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); Index: branches/azimutz/Chazileon/i386/libsa/qsort.c =================================================================== --- branches/azimutz/Chazileon/i386/libsa/qsort.c (revision 456) +++ branches/azimutz/Chazileon/i386/libsa/qsort.c (revision 457) @@ -58,10 +58,12 @@ #include #include +#include "saio_types.h" //Azi: min/max + static inline char *med3 __P((char *, char *, char *, int (*)())); static inline void swapfunc __P((char *, char *, int, int)); -#define min(a, b) (a) < (b) ? a : b +//#define min(a, b) (a) < (b) ? a : b Azi: defined on saio_types.h /* * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". Index: branches/azimutz/CleanCut/i386/boot2/graphics.c =================================================================== --- branches/azimutz/CleanCut/i386/boot2/graphics.c (revision 456) +++ branches/azimutz/CleanCut/i386/boot2/graphics.c (revision 457) @@ -43,7 +43,7 @@ #define VIDEO(x) (bootArgs->Video.v_ ## x) -//#define min(x, y) ((x) < (y) ? (x) : (y)) Azi: it's defined on saio_types.h +#define MIN(x, y) ((x) < (y) ? (x) : (y)) //========================================================================== // getVBEInfoString @@ -591,8 +591,8 @@ uint16_t drawWidth; uint8_t *vram = (uint8_t *) VIDEO(baseAddr) + VIDEO(rowBytes) * y + 4 * x; - drawWidth = min(width, VIDEO(width) - x); - height = min(height, VIDEO(height) - y); + drawWidth = MIN(width, VIDEO(width) - x); + height = MIN(height, VIDEO(height) - y); while (height--) { switch (VIDEO (depth)) { @@ -771,8 +771,8 @@ vram = (char *) VIDEO(baseAddr) + VIDEO(rowBytes) * y + pixelBytes * x; - width = min(width, VIDEO(width) - x); - height = min(height, VIDEO(height) - y); + width = MIN(width, VIDEO(width) - x); + height = MIN(height, VIDEO(height) - y); while ( height-- ) { @@ -797,8 +797,8 @@ unsigned char * vram = (unsigned char *) VIDEO(baseAddr) + VIDEO(rowBytes) * y + pixelBytes * x; - drawWidth = min(width, VIDEO(width) - x); - height = min(height, VIDEO(height) - y); + drawWidth = MIN(width, VIDEO(width) - x); + height = MIN(height, VIDEO(height) - y); while ( height-- ) { bcopy( data, vram, drawWidth * pixelBytes ); vram += VIDEO(rowBytes); Index: branches/azimutz/CleanCut/i386/boot2/gui.c =================================================================== --- branches/azimutz/CleanCut/i386/boot2/gui.c (revision 456) +++ branches/azimutz/CleanCut/i386/boot2/gui.c (revision 457) @@ -22,8 +22,8 @@ #define LOADPNG(img, alt_img) if (loadThemeImage(#img, alt_img) != 0) { return 1; } -//#define min(x, y) ((x) < (y) ? (x) : (y)) Azi: it's defined on saio_types.h -//#define max(x, y) ((x) > (y) ? (x) : (y)) || || +#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#define MAX(x, y) ((x) > (y) ? (x) : (y)) #define VIDEO(x) (bootArgs->Video.v_ ## x) @@ -469,7 +469,7 @@ const char *string; if(getIntForKey("devices_max_visible", &val, theme )) - gui.maxdevices = min( val, gDeviceCount ); + gui.maxdevices = MIN( val, gDeviceCount ); if(getIntForKey("devices_iconspacing", &val, theme )) gui.devicelist.iconspacing = val; @@ -484,7 +484,7 @@ switch (gui.layout) { case VerticalLayout: - gui.devicelist.height = ((images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing) * min(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->height + images[iDeviceScrollNext].image->height) + gui.devicelist.iconspacing); + gui.devicelist.height = ((images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->height + images[iDeviceScrollNext].image->height) + gui.devicelist.iconspacing); gui.devicelist.width = (images[iSelection].image->width + gui.devicelist.iconspacing); if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , images[iSelection].image->width ) ) @@ -496,7 +496,7 @@ case HorizontalLayout: default: - gui.devicelist.width = ((images[iSelection].image->width + gui.devicelist.iconspacing) * min(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->width + images[iDeviceScrollNext].image->width) + gui.devicelist.iconspacing); + gui.devicelist.width = ((images[iSelection].image->width + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->width + images[iDeviceScrollNext].image->width) + gui.devicelist.iconspacing); gui.devicelist.height = (images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing); if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , gui.devicelist.width ) ) @@ -540,10 +540,10 @@ gui.screen.bgcolor = (color & 0x00FFFFFF); if(getIntForKey("screen_textmargin_h", &val, theme)) - gui.screen.hborder = min( gui.screen.width , val ); + gui.screen.hborder = MIN( gui.screen.width , val ); if(getIntForKey("screen_textmargin_v", &val, theme)) - gui.screen.vborder = min( gui.screen.height , val ); + gui.screen.vborder = MIN( gui.screen.height , val ); /* * Parse background parameters @@ -590,10 +590,10 @@ * Parse infobox parameters */ if(getIntForKey("infobox_width", &val, theme)) - gui.infobox.width = min( screen_width , val ); + gui.infobox.width = MIN( screen_width , val ); if(getIntForKey("infobox_height", &val, theme)) - gui.infobox.height = min( screen_height , val ); + gui.infobox.height = MIN( screen_height , val ); if(getDimensionForKey("infobox_pos_x", &pixel, theme, screen_width , gui.infobox.width ) ) gui.infobox.pos.x = pixel; @@ -602,10 +602,10 @@ gui.infobox.pos.y = pixel; if(getIntForKey("infobox_textmargin_h", &val, theme)) - gui.infobox.hborder = min( gui.infobox.width , val ); + gui.infobox.hborder = MIN( gui.infobox.width , val ); if(getIntForKey("infobox_textmargin_v", &val, theme)) - gui.infobox.vborder = min( gui.infobox.height , val ); + gui.infobox.vborder = MIN( gui.infobox.height , val ); if(getColorForKey("infobox_bgcolor", &color, theme)) gui.infobox.bgcolor = (color & 0x00FFFFFF); @@ -633,10 +633,10 @@ gui.menu.pos.y = pixel; if(getIntForKey("menu_textmargin_h", &val, theme)) - gui.menu.hborder = min( gui.menu.width , val ); + gui.menu.hborder = MIN( gui.menu.width , val ); if(getIntForKey("menu_textmargin_v", &val, theme)) - gui.menu.vborder = min( gui.menu.height , val ); + gui.menu.vborder = MIN( gui.menu.height , val ); if(getColorForKey("menu_bgcolor", &color, theme)) gui.menu.bgcolor = (color & 0x00FFFFFF); @@ -651,7 +651,7 @@ gui.bootprompt.width = pixel; if(getIntForKey("bootprompt_height", &val, theme)) - gui.bootprompt.height = min( screen_height , val ); + gui.bootprompt.height = MIN( screen_height , val ); if(getDimensionForKey("bootprompt_pos_x", &pixel, theme, screen_width , gui.bootprompt.width ) ) gui.bootprompt.pos.x = pixel; @@ -660,10 +660,10 @@ gui.bootprompt.pos.y = pixel; if(getIntForKey("bootprompt_textmargin_h", &val, theme)) - gui.bootprompt.hborder = min( gui.bootprompt.width , val ); + gui.bootprompt.hborder = MIN( gui.bootprompt.width , val ); if(getIntForKey("bootprompt_textmargin_v", &val, theme)) - gui.bootprompt.vborder = min( gui.bootprompt.height , val ); + gui.bootprompt.vborder = MIN( gui.bootprompt.height , val ); if(getColorForKey("bootprompt_bgcolor", &color, theme)) gui.bootprompt.bgcolor = (color & 0x00FFFFFF); @@ -731,7 +731,8 @@ if (createWindowBuffer(&gui.devicelist) == 0) { if (createWindowBuffer(&gui.bootprompt) == 0) { if (createWindowBuffer(&gui.infobox) == 0) { - if (createWindowBuffer(&gui.menu) == 0) { + if (createWindowBuffer(&gui.menu) == 0) { + gui.logo.draw = true; drawBackground(); // lets copy the screen into the back buffer memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); @@ -808,7 +809,7 @@ int i; position_t p, p_prev, p_next; - //uint8_t maxDevices = min( gui.maxdevices, menucount ); + //uint8_t maxDevices = MIN( gui.maxdevices, menucount ); fillPixmapWithColor( gui.devicelist.pixmap, gui.devicelist.bgcolor); @@ -1065,8 +1066,8 @@ int i; int character; - origin.x = max( window->cursor.x, window->hborder ); - origin.y = max( window->cursor.y, window->vborder ); + origin.x = MAX( window->cursor.x, window->hborder ); + origin.y = MAX( window->cursor.y, window->vborder ); bounds.x = ( window->width - window->hborder ); bounds.y = ( window->height - window->vborder ); @@ -1150,8 +1151,8 @@ int i; int character; - origin.x = max( gui.debug.cursor.x, window->hborder ); - origin.y = max( gui.debug.cursor.y, window->vborder ); + origin.x = MAX( gui.debug.cursor.x, window->hborder ); + origin.y = MAX( gui.debug.cursor.y, window->vborder ); bounds.x = ( window->width - window->hborder ); bounds.y = ( window->height - window->vborder ); @@ -1230,8 +1231,8 @@ prf(fmt, ap, sputc, &pi); *pi.str = '\0'; - origin.x = max( window->cursor.x, window->hborder ); - origin.y = max( window->cursor.y, window->vborder ); + origin.x = MAX( window->cursor.x, window->hborder ); + origin.y = MAX( window->cursor.y, window->vborder ); bounds.x = ( window->width - ( window->hborder * 2 ) ); bounds.y = ( window->height - ( window->vborder * 2 ) ); cursor = origin; @@ -1864,8 +1865,8 @@ drawColorRectangle(0, 0, screen_params[0], screen_params[1], 0x01); } if ((bootImageData) && (usePngImage)) { - x = (screen_params[0] - min(bootImageWidth, screen_params[0])) / 2; - y = (screen_params[1] - min(bootImageHeight, screen_params[1])) / 2; + x = (screen_params[0] - MIN(bootImageWidth, screen_params[0])) / 2; + y = (screen_params[1] - MIN(bootImageHeight, screen_params[1])) / 2; // Draw the image in the center of the display. blendImage(x, y, bootImageWidth, bootImageHeight, bootImageData); @@ -1880,8 +1881,8 @@ if (appleBootPict) { convertImage(bootImageWidth, bootImageHeight, appleBootPict, &bootImageData); if (bootImageData) { - x = (screen_params[0] - min(kAppleBootWidth, screen_params[0])) / 2; - y = (screen_params[1] - min(kAppleBootHeight, screen_params[1])) / 2; + x = (screen_params[0] - MIN(kAppleBootWidth, screen_params[0])) / 2; + y = (screen_params[1] - MIN(kAppleBootHeight, screen_params[1])) / 2; drawDataRectangle(x, y, kAppleBootWidth, kAppleBootHeight, bootImageData); free(bootImageData); }