mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Make compile with MSVC6++
This commit is contained in:
parent
eedb4c638a
commit
3893f6f158
@ -302,9 +302,10 @@ int seventeen_ten(unsigned char source[], int position, int length) {
|
||||
* returning the resulting number of codewords (Annex F.II.E)
|
||||
*/
|
||||
int ahead_c(unsigned char source[], int position, int length) {
|
||||
int count = 0;
|
||||
int count = 0;
|
||||
int i;
|
||||
|
||||
for (int i = position; (i < length) && datum_c(source, i, length); i += 2) {
|
||||
for (i = position; (i < length) && datum_c(source, i, length); i += 2) {
|
||||
count++;
|
||||
}
|
||||
|
||||
@ -326,9 +327,10 @@ int try_c(unsigned char source[], int position, int length) {
|
||||
|
||||
/* Annex F.II.G */
|
||||
int ahead_a(unsigned char source[], int position, int length) {
|
||||
int count = 0;
|
||||
int count = 0;
|
||||
int i;
|
||||
|
||||
for (int i = position; ((i < length) && datum_a(source, i, length))
|
||||
for (i = position; ((i < length) && datum_a(source, i, length))
|
||||
&& (try_c(source, i, length) < 2); i++) {
|
||||
count++;
|
||||
}
|
||||
@ -338,9 +340,10 @@ int ahead_a(unsigned char source[], int position, int length) {
|
||||
|
||||
/* Annex F.II.H */
|
||||
int ahead_b(unsigned char source[], int position, int length) {
|
||||
int count = 0;
|
||||
int count = 0;
|
||||
int i;
|
||||
|
||||
for (int i = position; ((i < length) && datum_b(source, i, length))
|
||||
for (i = position; ((i < length) && datum_b(source, i, length))
|
||||
&& (try_c(source, i, length) < 2); i++) {
|
||||
count++;
|
||||
}
|
||||
@ -1047,6 +1050,8 @@ int dotcode(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
unsigned char codeword_array[length * 3];
|
||||
unsigned char masked_codeword_array[length * 3];
|
||||
#else
|
||||
char* dot_stream;
|
||||
char* dot_array;
|
||||
unsigned char* codeword_array = (unsigned char *) _alloca(length * 3 * sizeof (unsigned char));
|
||||
unsigned char* masked_codeword_array = (unsigned char *) _alloca(length * 3 * sizeof (unsigned char));
|
||||
#endif /* _MSC_VER */
|
||||
@ -1094,8 +1099,8 @@ int dotcode(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
char dot_stream[n_dots + 3];
|
||||
char dot_array[width * height];
|
||||
#else
|
||||
char* dot_stream = (char *) _alloca((n_dots + 3) * sizeof (char));
|
||||
char* dot_array = (char *) _alloca(width * height * sizeof (char));
|
||||
dot_stream = (char *) _alloca((n_dots + 3) * sizeof (char));
|
||||
dot_array = (char *) _alloca(width * height * sizeof (char));
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Add pad characters */
|
||||
|
@ -290,7 +290,7 @@ int get_best_eci(unsigned char source[], int length) {
|
||||
#ifndef _MSC_VER
|
||||
unsigned char local_source[length + 1];
|
||||
#else
|
||||
local_source = (unsigned char*) _alloca(length + 1);
|
||||
unsigned char *local_source = (unsigned char*) _alloca(length + 1);
|
||||
#endif
|
||||
|
||||
do {
|
||||
|
Loading…
Reference in New Issue
Block a user