Skip to content
This repository has been archived by the owner on Jan 14, 2023. It is now read-only.

Commit

Permalink
fixed warning for float cast
Browse files Browse the repository at this point in the history
  • Loading branch information
stohn committed Mar 2, 2015
1 parent 6d2501d commit 5316ccf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/up2gcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <stdbool.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>

#define STEPS_X (854.0)
#define STEPS_Y (854.0)
Expand Down Expand Up @@ -157,7 +158,11 @@ void _dat_cmd_SetParameter( int32_t param, int32_t value )
break;

case PARA_REPORT_HEIGHT:
printf( "Report Height: %.3f", *((float*)&value) );
{
float f;
memcpy( &f, &value, sizeof(f) );
printf( "Report Height: %.3f", f );
}
break;

case PARA_NOZZLE1_TEMP:
Expand Down Expand Up @@ -271,4 +276,4 @@ int main(int argc, char *argv[])
fclose( fdat );

return 0;
}
}

0 comments on commit 5316ccf

Please sign in to comment.