Chameleon

Chameleon Commit Details

Date:2010-10-29 18:43:22 (13 years 4 months ago)
Author:Azimutz
Commit:621
Parents: 620
Message:Reverting these to upper case (i changed most of them to lower case a while ago); they are macros, which according to some reading should use upper case to distinguish them from functions... makes sense to me.
Changes:
M/branches/azimutz/Chazi/i386/boot2/options.c
M/branches/azimutz/Chazi/i386/libsaio/sys.c
M/branches/azimutz/Chazi/i386/libsaio/load.c
M/branches/azimutz/Chazi/i386/libsa/qsort.c
M/branches/azimutz/Chazi/i386/boot2/graphics.c
M/branches/azimutz/Chazi/i386/libsaio/saio_types.h
M/branches/azimutz/Chazi/i386/libsaio/msdos.c
M/branches/azimutz/Chazi/i386/boot2/gui.c
M/branches/azimutz/Chazi/i386/libsaio/cpu.c
M/branches/azimutz/Chazi/i386/libsaio/disk.c
M/branches/azimutz/Chazi/i386/libsaio/autoresolution.c

File differences

branches/azimutz/Chazi/i386/libsaio/autoresolution.c
738738
739739
740740
741
741
742742
743743
744744
if (gDeviceCount)
{
showMenu( menuItems, gDeviceCount, selectIndex, kMenuTopRow + 2, kMenuMaxItems );
nextRow += min( gDeviceCount, kMenuMaxItems ) + 3;
nextRow += MIN( gDeviceCount, kMenuMaxItems ) + 3;
}
// Show the boot prompt.
branches/azimutz/Chazi/i386/libsaio/sys.c
458458
459459
460460
461
461
462462
463463
464464
if ((iob[i].i_flgs != F_ALLOC) || (i == fdesc)) {
continue;
}
io->i_buf = max(iob[i].i_filesize + iob[i].i_buf, io->i_buf);
io->i_buf = MAX(iob[i].i_filesize + iob[i].i_buf, io->i_buf);
}
// Load entire file into memory. Unnecessary open() calls must be avoided.
branches/azimutz/Chazi/i386/libsaio/load.c
152152
153153
154154
155
156
155
156
157157
158158
159159
case LC_SEGMENT:
ret = DecodeSegment(cmdBase, &load_addr, &load_size);
if (ret == 0 && load_size != 0 && load_addr >= KERNEL_ADDR) {
vmaddr = min(vmaddr, load_addr);
vmend = max(vmend, load_addr + load_size);
vmaddr = MIN(vmaddr, load_addr);
vmend = MAX(vmend, load_addr + load_size);
}
break;
branches/azimutz/Chazi/i386/libsaio/cpu.c
5454
5555
5656
57
57
5858
5959
6060
......
152152
153153
154154
155
155
156156
157157
158158
*/
if((tscEnd - tscStart) <= CALIBRATE_TIME_MSEC)
continue;
// tscDelta = min(tscDelta, (tscEnd - tscStart))
// tscDelta = MIN(tscDelta, (tscEnd - tscStart))
if( (tscEnd - tscStart) < tscDelta )
tscDelta = tscEnd - tscStart;
}
strlcpy(p->CPU.BrandString,s, sizeof(p->CPU.BrandString));
if (!strncmp(p->CPU.BrandString, CPU_STRING_UNKNOWN, min(sizeof(p->CPU.BrandString), strlen(CPU_STRING_UNKNOWN) + 1))) {
if (!strncmp(p->CPU.BrandString, CPU_STRING_UNKNOWN, MIN(sizeof(p->CPU.BrandString), strlen(CPU_STRING_UNKNOWN) + 1))) {
/*
* This string means we have a firmware-programmable brand string,
* and the firmware couldn't figure out what sort of CPU we have.
branches/azimutz/Chazi/i386/libsaio/disk.c
17781778
17791779
17801780
1781
1781
17821782
17831783
17841784
if ( matchVolumeToString(bvr, volStart, volLen) )
{
strncat(str, aliasStart, min(strMaxLen, aliasLen));
strncat(str, aliasStart, MIN(strMaxLen, aliasLen));
free(aliasList);
return true;
branches/azimutz/Chazi/i386/libsaio/saio_types.h
232232
233233
234234
235
236
235
236
237237
238238
239239
};
//Azi: change this stuff back to upercase??
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#defineround2(x, m)(((x) + (m / 2)) & ~(m - 1))
#define roundup2(x, m) (((x) + m - 1) & ~(m - 1))
branches/azimutz/Chazi/i386/libsaio/msdos.c
772772
773773
774774
775
775
776776
777777
778
778
779779
780780
781781
if (length==0 || length>size-offset)
toread=size-offset;
wastoread=toread;
bcopy (buf+(offset%msdosclustersize),ptr,min(msdosclustersize-(offset%msdosclustersize), toread));
bcopy (buf+(offset%msdosclustersize),ptr,MIN(msdosclustersize-(offset%msdosclustersize), toread));
ptr+=msdosclustersize-(offset%msdosclustersize);
toread-=msdosclustersize-(offset%msdosclustersize);
while (toread>0 && msdosreadcluster (ih, (uint8_t *)ptr, min(msdosclustersize,toread), &cluster))
while (toread>0 && msdosreadcluster (ih, (uint8_t *)ptr, MIN(msdosclustersize,toread), &cluster))
{
ptr+=msdosclustersize;
toread-=msdosclustersize;
branches/azimutz/Chazi/i386/boot2/graphics.c
609609
610610
611611
612
613
612
613
614614
615615
616616
......
789789
790790
791791
792
793
792
793
794794
795795
796796
......
815815
816816
817817
818
819
818
819
820820
821821
822822
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))
{
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-- )
{
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);
branches/azimutz/Chazi/i386/boot2/gui.c
460460
461461
462462
463
463
464464
465465
466466
......
475475
476476
477477
478
478
479479
480480
481481
......
487487
488488
489489
490
490
491491
492492
493493
......
531531
532532
533533
534
534
535535
536536
537
537
538538
539539
540540
......
581581
582582
583583
584
584
585585
586586
587
587
588588
589589
590590
......
593593
594594
595595
596
596
597597
598598
599
599
600600
601601
602602
......
624624
625625
626626
627
627
628628
629629
630
630
631631
632632
633633
......
642642
643643
644644
645
645
646646
647647
648648
......
651651
652652
653653
654
654
655655
656656
657
657
658658
659659
660660
......
823823
824824
825825
826
826
827827
828828
829829
......
10861086
10871087
10881088
1089
1090
1089
1090
10911091
10921092
10931093
......
11711171
11721172
11731173
1174
1175
1174
1175
11761176
11771177
11781178
......
12511251
12521252
12531253
1254
1255
1254
1255
12561256
12571257
12581258
......
19141914
19151915
19161916
1917
1918
1917
1918
19191919
19201920
19211921
......
19301930
19311931
19321932
1933
1934
1933
1934
19351935
19361936
19371937
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;
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 ) )
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 ) )
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
* 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;
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);
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);
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;
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);
extern bool showBootBanner; //||
position_tp, p_prev, p_next;
//uint8_tmaxDevices = min( gui.maxdevices, menucount );
//uint8_tmaxDevices = MIN( gui.maxdevices, menucount );
fillPixmapWithColor( gui.devicelist.pixmap, gui.devicelist.bgcolor);
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 );
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 );
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;
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);
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);
}
branches/azimutz/Chazi/i386/boot2/options.c
316316
317317
318318
319
319
320320
321321
322322
323
323
324324
325325
326326
......
907907
908908
909909
910
910
911911
912912
913913
......
10581058
10591059
10601060
1061
1061
10621062
10631063
10641064
......
13961396
13971397
13981398
1399
1399
14001400
14011401
14021402
gMenuHeight= height;
gMenuItemCount= count;
gMenuTop= 0;
gMenuBottom= min( count, height ) - 1;
gMenuBottom= MIN( count, height ) - 1;
gMenuSelection= selection;
gMenuStart= 0;
gMenuEnd = min( count, gui.maxdevices ) - 1;
gMenuEnd = MIN( count, gui.maxdevices ) - 1;
// If the selected item is not visible, shift the list down.
printf("Use \30\31 keys to select the startup volume.");
}
showMenu( menuItems, gDeviceCount, selectIndex, kMenuTopRow + 2, kMenuMaxItems );
nextRow += min( gDeviceCount, kMenuMaxItems ) + 3;
nextRow += MIN( gDeviceCount, kMenuMaxItems ) + 3;
}
// Show the boot prompt.
if (gDeviceCount) {
printf("Use \30\31 keys to select the startup volume.");
showMenu(menuItems, gDeviceCount, selectIndex, kMenuTopRow + 2, kMenuMaxItems);
nextRow += min(gDeviceCount, kMenuMaxItems) + 3;
nextRow += MIN(gDeviceCount, kMenuMaxItems) + 3;
}
showPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot);
// getValueForKey uses const char for val
// so copy it and trim
*str = '\0';
strncat(str, val, min(len, 4));
strncat(str, val, MIN(len, 4));
}
else
valid = false;
branches/azimutz/Chazi/i386/libsa/qsort.c
178178
179179
180180
181
181
182182
183
183
184184
185185
186186
}
pn = a + n * es;
r = min(pa - (char *)a, pb - pa);
r = MIN(pa - (char *)a, pb - pa);
vecswap(a, pb - r, r);
r = min(pd - pc, (pn - pd) - (int)es);
r = MIN(pd - pc, (pn - pd) - (int)es);
vecswap(pb, pn - r, r);
if ((r = pb - pa) > (int)es)
qsort(a, r / es, es, cmp);

Archive Download the corresponding diff file

Revision: 621