-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* tumble: build a PDF file from image files | ||
* | ||
* bitblt table generator | ||
* $Id: bitblt_table_gen.c,v 1.7 2003/03/13 00:57:05 eric Exp $ | ||
* $Id: bitblt_table_gen.c,v 1.8 2003/08/18 01:59:41 eric Exp $ | ||
* Copyright 2003 Eric Smith <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
|
@@ -71,6 +71,16 @@ int count_run (int byte, int start_bit, int desired_val) | |
int count = 0; | ||
int i; | ||
|
||
#ifdef WORDS_BIGENDIAN | ||
for (i = 7 - start_bit; i >= 0; i--) | ||
{ | ||
int bit = (byte >> i) & 1; | ||
if (bit == desired_val) | ||
count++; | ||
else | ||
break; | ||
} | ||
#else | ||
for (i = start_bit; i < 8; i++) | ||
{ | ||
int bit = (byte >> i) & 1; | ||
|
@@ -79,6 +89,8 @@ int count_run (int byte, int start_bit, int desired_val) | |
else | ||
break; | ||
} | ||
#endif | ||
|
||
return (count); | ||
} | ||
|
||
|