modifications for VS2015, some

additional static/const's and a few bugfixes for HanXin and DotStream.

Patch by Michael <virtual_worlds@gmx.de>
This commit is contained in:
Robin Stuart 2016-09-05 22:06:50 +01:00
parent 8d3abf8440
commit 2c2200a7cb
31 changed files with 1639 additions and 1278 deletions

View file

@ -35,6 +35,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <malloc.h>
#include "common.h"
#define SSET "0123456789ABCDEF"
@ -63,7 +64,7 @@ int svg_plot(struct zint_symbol *symbol) {
strcpy(addon, "");
comp_offset = 0;
addon_text_posn = 0.0;
if (symbol->show_hrt != 0) {
/* Copy text from symbol */
ustrcpy(local_text, symbol->text);
@ -215,9 +216,9 @@ int svg_plot(struct zint_symbol *symbol) {
fprintf(fsvg, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n");
fprintf(fsvg, " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
if (symbol->symbology != BARCODE_MAXICODE) {
fprintf(fsvg, "<svg width=\"%d\" height=\"%d\" version=\"1.1\"\n", (int)ceil((symbol->width + xoffset + xoffset) * scaler), (int)ceil((symbol->height + textoffset + yoffset + yoffset) * scaler));
fprintf(fsvg, "<svg width=\"%d\" height=\"%d\" version=\"1.1\"\n", (int) ceil((symbol->width + xoffset + xoffset) * scaler), (int) ceil((symbol->height + textoffset + yoffset + yoffset) * scaler));
} else {
fprintf(fsvg, "<svg width=\"%d\" height=\"%d\" version=\"1.1\"\n", (int)ceil((74.0F + xoffset + xoffset) * scaler), (int)ceil((72.0F + yoffset + yoffset) * scaler));
fprintf(fsvg, "<svg width=\"%d\" height=\"%d\" version=\"1.1\"\n", (int) ceil((74.0F + xoffset + xoffset) * scaler), (int) ceil((72.0F + yoffset + yoffset) * scaler));
}
fprintf(fsvg, " xmlns=\"http://www.w3.org/2000/svg\">\n");
if ((ustrlen(local_text) != 0) && (symbol->show_hrt != 0)) {
@ -229,9 +230,9 @@ int svg_plot(struct zint_symbol *symbol) {
fprintf(fsvg, "\n <g id=\"barcode\" fill=\"#%s\">\n", symbol->fgcolour);
if (symbol->symbology != BARCODE_MAXICODE) {
fprintf(fsvg, " <rect x=\"0\" y=\"0\" width=\"%d\" height=\"%d\" fill=\"#%s\" />\n", (int)ceil((symbol->width + xoffset + xoffset) * scaler), (int)ceil((symbol->height + textoffset + yoffset + yoffset) * scaler), symbol->bgcolour);
fprintf(fsvg, " <rect x=\"0\" y=\"0\" width=\"%d\" height=\"%d\" fill=\"#%s\" />\n", (int) ceil((symbol->width + xoffset + xoffset) * scaler), (int) ceil((symbol->height + textoffset + yoffset + yoffset) * scaler), symbol->bgcolour);
} else {
fprintf(fsvg, " <rect x=\"0\" y=\"0\" width=\"%d\" height=\"%d\" fill=\"#%s\" />\n", (int)ceil((74.0F + xoffset + xoffset) * scaler), (int)ceil((72.0F + yoffset + yoffset) * scaler), symbol->bgcolour);
fprintf(fsvg, " <rect x=\"0\" y=\"0\" width=\"%d\" height=\"%d\" fill=\"#%s\" />\n", (int) ceil((74.0F + xoffset + xoffset) * scaler), (int) ceil((72.0F + yoffset + yoffset) * scaler), symbol->bgcolour);
}
if ((symbol->output_options & BARCODE_BOX) || (symbol->output_options & BARCODE_BIND)) {
@ -310,8 +311,8 @@ int svg_plot(struct zint_symbol *symbol) {
}
}
row_posn += yoffset;
if (symbol->output_options & BARCODE_DOTTY_MODE) {
if (symbol->output_options & BARCODE_DOTTY_MODE) {
/* Use (currently undocumented) dot mode - see SF ticket #29 */
for (i = 0; i < symbol->width; i++) {
if (module_is_set(symbol, this_row, i)) {
@ -326,7 +327,7 @@ int svg_plot(struct zint_symbol *symbol) {
} else {
latch = 0;
}
do {
block_width = 0;
do {