summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominic Radermacher <dominic@familie-radermacher.ch>2022-09-11 06:45:00 +0200
committerDominic Radermacher <dominic@familie-radermacher.ch>2022-09-11 06:45:00 +0200
commitf56d7ea740b5a0b00d6ae73f7afb2839d0a8aef4 (patch)
treefae6a6e78a3cdb1df43772dead521825d1e3f113
parent71396e8ff1f92f70bf67584a9b65315229fedfb6 (diff)
fix some compile warnings
-rw-r--r--CMakeLists.txt5
-rw-r--r--include/ptouch.h3
-rw-r--r--src/libptouch.c4
-rw-r--r--src/ptouch-print.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 757f557..94a9a13 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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
diff --git a/include/ptouch.h b/include/ptouch.h
index 8a05b25..d33c2b9 100644
--- a/include/ptouch.h
+++ b/include/ptouch.h
@@ -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);
diff --git a/src/libptouch.c b/src/libptouch.c
index 917edef..b68cb16 100644
--- a/src/libptouch.c
+++ b/src/libptouch.c
@@ -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)
diff --git a/src/ptouch-print.c b/src/ptouch-print.c
index b959850..7924413 100644
--- a/src/ptouch-print.c
+++ b/src/ptouch-print.c
@@ -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) {