264 |
|
char *match = strchr(mainBuffer.dirtyPages + page, PFLAG_CLEAR_VALUE); |
265 |
|
return match ? match - mainBuffer.dirtyPages : mainBuffer.pageCount; |
266 |
|
#else |
267 |
– |
// NOTE: the loop is bound to terminate because the last |
268 |
– |
// page in mainBuffer.dirtyPages[] shall be set to CLEAR |
267 |
|
while (PFLAG_ISSET_4(page)) |
268 |
|
page += 4; |
269 |
|
while (PFLAG_ISSET(page)) |
943 |
|
if (mainBuffer.dirtyPages != 0) |
944 |
|
free(mainBuffer.dirtyPages); |
945 |
|
|
946 |
< |
mainBuffer.dirtyPages = (char *) malloc(mainBuffer.pageCount + 1); |
946 |
> |
mainBuffer.dirtyPages = (char *) malloc(mainBuffer.pageCount + 2); |
947 |
|
|
948 |
|
if (mainBuffer.pageInfo != 0) |
949 |
|
free(mainBuffer.pageInfo); |
954 |
|
return false; |
955 |
|
|
956 |
|
PFLAG_CLEAR_ALL; |
957 |
< |
|
958 |
< |
// Make sure there is at least one page marked, so the |
961 |
< |
// loops in the update routine will terminate |
962 |
< |
// gb-- Set the last page as cleared because the update |
963 |
< |
// routine finally searches for a page that was not touched |
957 |
> |
// Safety net to insure the loops in the update routines will terminate |
958 |
> |
// See a discussion in <video_vosf.h> for further details |
959 |
|
PFLAG_CLEAR(mainBuffer.pageCount); |
960 |
+ |
PFLAG_SET(mainBuffer.pageCount+1); |
961 |
|
|
962 |
|
uint32 a = 0; |
963 |
|
for (int i = 0; i < mainBuffer.pageCount; i++) { |
1951 |
|
|
1952 |
|
// We suggest the compiler to inline the next two functions so that it |
1953 |
|
// may specialise the code according to the current screen depth and |
1954 |
< |
// display type. A clever compiler would that job by itself though... |
1954 |
> |
// display type. A clever compiler would do that job by itself though... |
1955 |
|
|
1956 |
|
// NOTE: update_display_vosf is inlined too |
1957 |
|
|