mirror of
https://git.familie-radermacher.ch/linux/ptouch-print.git
synced 2025-05-13 23:32:59 +00:00
fix some compile warnings
This commit is contained in:
parent
71396e8ff1
commit
f56d7ea740
@ -46,14 +46,15 @@ target_include_directories(ptouch-print PUBLIC
|
||||
${GD_INCLUDE_DIR}
|
||||
${LIBUSB_INCLUDE_DIRS}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${Libintl_INCLUDE_DIRS}
|
||||
${Intl_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# Configure linker
|
||||
target_link_libraries(ptouch-print
|
||||
${GD_LIBRARIES}
|
||||
${LIBUSB_LIBRARIES}
|
||||
${Libintl_LIBRARY}
|
||||
${LIBUSB_LINK_LIBRARIES}
|
||||
${Intl_LIBRARY}
|
||||
)
|
||||
|
||||
# Add a custom command that produces version.h, plus a dummy output that's
|
||||
|
@ -96,7 +96,7 @@ int ptouch_send(ptouch_dev ptdev, uint8_t *data, size_t len);
|
||||
int ptouch_init(ptouch_dev ptdev);
|
||||
int ptouch_lf(ptouch_dev ptdev);
|
||||
int ptouch_ff(ptouch_dev ptdev);
|
||||
size_t ptouch_get_max_pixel_width(ptouch_dev ptdev);
|
||||
size_t ptouch_get_max_width(ptouch_dev ptdev);
|
||||
size_t ptouch_get_tape_width(ptouch_dev ptdev);
|
||||
int ptouch_page_flags(ptouch_dev ptdev, uint8_t page_flags);
|
||||
int ptouch_eject(ptouch_dev ptdev);
|
||||
@ -106,6 +106,7 @@ int ptouch_enable_packbits(ptouch_dev ptdev);
|
||||
int ptouch_info_cmd(ptouch_dev ptdev, int size_x);
|
||||
int ptouch_rasterstart(ptouch_dev ptdev);
|
||||
int ptouch_sendraster(ptouch_dev ptdev, uint8_t *data, size_t len);
|
||||
void ptouch_rawstatus(uint8_t raw[32]);
|
||||
void ptouch_list_supported();
|
||||
|
||||
const char* pt_mediatype(unsigned char media_type);
|
||||
|
@ -79,8 +79,6 @@ struct _pt_dev_info ptdevs[] = {
|
||||
{0,0,"",0,0,0}
|
||||
};
|
||||
|
||||
void ptouch_rawstatus(uint8_t raw[32]);
|
||||
|
||||
int ptouch_open(ptouch_dev *ptdev)
|
||||
{
|
||||
libusb_device **devs;
|
||||
@ -191,7 +189,7 @@ int ptouch_init(ptouch_dev ptdev)
|
||||
memset(cmd, 0, 100);
|
||||
cmd[100] = 0x1b; /* ESC */
|
||||
cmd[101] = 0x40; /* @ */
|
||||
return ptouch_send(ptdev, (uint8_t *)cmd, strlen(cmd));
|
||||
return ptouch_send(ptdev, (uint8_t *)cmd, sizeof(cmd));
|
||||
}
|
||||
|
||||
int ptouch_enable_packbits(ptouch_dev ptdev)
|
||||
|
@ -92,7 +92,7 @@ int print_img(ptouch_dev ptdev, gdImage *im)
|
||||
//offset=64-(gdImageSY(im)/2); /* always print centered */
|
||||
size_t max_pixels=ptouch_get_max_width(ptdev);
|
||||
offset=((int)max_pixels / 2)-(gdImageSY(im)/2); /* always print centered */
|
||||
printf("max_pixels=%d, offset=%d\n", max_pixels, offset);
|
||||
printf("max_pixels=%ld, offset=%d\n", max_pixels, offset);
|
||||
if ((ptdev->devinfo->flags & FLAG_RASTER_PACKBITS) == FLAG_RASTER_PACKBITS) {
|
||||
if (debug) {
|
||||
printf("enable PackBits mode\n");
|
||||
@ -528,7 +528,7 @@ int main(int argc, char *argv[])
|
||||
printf("text color = %02x (%s)\n", ptdev->status->text_color, pt_textcolor(ptdev->status->text_color));
|
||||
printf("error = %04x\n", ptdev->status->error);
|
||||
if (debug) {
|
||||
ptouch_rawstatus(ptdev->status);
|
||||
ptouch_rawstatus((uint8_t *)ptdev->status);
|
||||
}
|
||||
exit(0);
|
||||
} else if (strcmp(&argv[i][1], "-image") == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user