openbsd-ports/devel/libmtp/patches/patch-examples_thumb_c
jasper 8756029f01 - update libmtp to 1.0.3
from LEVAI Daniel, with some tweaks by me
ok william@ (MAINTAINER)
2010-12-21 18:16:04 +00:00

34 lines
944 B
Plaintext

$OpenBSD: patch-examples_thumb_c,v 1.2 2010/12/21 18:16:04 jasper Exp $
Fix compilation with GCC2.
--- examples/thumb.c.orig Mon Jun 15 21:45:12 2009
+++ examples/thumb.c Tue Dec 21 14:07:54 2010
@@ -44,6 +44,7 @@ int main (int argc, char **argv) {
extern int optind;
extern char *optarg;
LIBMTP_mtpdevice_t *device = NULL;
+ LIBMTP_filesampledata_t *thumb = NULL;
int fd;
uint32_t id = 0;
uint64_t filesize;
@@ -52,6 +53,7 @@ int main (int argc, char **argv) {
char *rest;
struct stat statbuff;
int ret;
+ int i;
fprintf(stdout, "libmtp version: " LIBMTP_VERSION_STRING "\n\n");
@@ -104,9 +106,8 @@ int main (int argc, char **argv) {
return 0;
}
- LIBMTP_filesampledata_t *thumb = LIBMTP_new_filesampledata_t();
+ thumb = LIBMTP_new_filesampledata_t();
- int i;
thumb->data = malloc(sizeof(uint16_t) * filesize);
for (i = 0; i < filesize; i++) {
thumb->data[i] = imagedata[i];