Browse Source

Fixed ported WriteFile issue (multi-purpose variables)

refactor
suhrke 3 years ago
parent
commit
4e555fd2da
2 changed files with 3 additions and 4 deletions
  1. 3
    1
      source/Printer.cpp
  2. 0
    3
      source/main.cpp

+ 3
- 1
source/Printer.cpp View File

@@ -853,7 +853,9 @@ void Printnextpage(t_printdata *print) {
pbmi->bmiHeader.biHeight=height;
pbmi->bmiHeader.biXPelsPerMeter=(print->ppix*10000)/254;
pbmi->bmiHeader.biYPelsPerMeter=(print->ppiy*10000)/254;
if ((fwrite(pbmi, sizeof(char), n, f) == 0) || (u!=(ulong)n)) {

u = fwrite(pbmi, sizeof(char), n, f);
if ( u != (ulong)n ) {
success=0;
}
};

+ 0
- 3
source/main.cpp View File

@@ -172,12 +172,9 @@ int main(int argc, char ** argv) {
// Construct superblock
if ( Initializeprinting( &printdata, WIDTH_A4, HEIGHT_A4 ) == 0 ) {
//Create BMPs until all data has been written to BMP
int bmpNo = 1;
int currStep = printdata.step;
while ( printdata.step == currStep ) {
cout << "Creating BMP #" << bmpNo << " " << outfile << endl;
Printnextpage( &printdata );
++bmpNo;
}
}
}

Loading…
Cancel
Save