Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More code cosmetic #1029

Merged
merged 11 commits into from
Sep 25, 2024
4 changes: 1 addition & 3 deletions camlibs/ptp2/chdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include "ptp.h"
#include "ptp-bugs.h"
#include "ptp-private.h"
#include "ptp-pack.c"

/* CHDK support */

Expand Down Expand Up @@ -1257,8 +1256,7 @@ static void yuv_live_to_ppm (unsigned char *p_yuv,
) {
const unsigned char *p_row = p_yuv;
const unsigned char *p;
unsigned int row, x;
unsigned int row_inc;
int row, x, row_inc;
int pshift, xshift, skip;
char ppm_header[32];
uint8_t rgb[6];
Expand Down
5 changes: 2 additions & 3 deletions camlibs/ptp2/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include "ptp.h"
#include "ptp-bugs.h"
#include "ptp-private.h"
#include "ptp-pack.c"

#ifdef __GNUC__
# define __unused__ __attribute__((unused))
Expand Down Expand Up @@ -424,7 +423,7 @@ camera_prepare_canon_eos_capture(Camera *camera, GPContext *context) {
GP_LOG_D ("deviceprop: %04x", x.DevicePropertiesSupported[i]);
for (i=0;i<x.unk_len;i++)
GP_LOG_D ("unk: %04x", x.unk[i]);
ptp_free_EOS_DI (&x);
ptp_canon_eos_free_deviceinfo (&x);
}

/* The new EOS occasionally returned an empty event set ... likely because we are too fast. try again some times. */
Expand All @@ -438,7 +437,7 @@ camera_prepare_canon_eos_capture(Camera *camera, GPContext *context) {

CR (camera_canon_eos_update_capture_target( camera, context, -1 ));

ptp_free_DI (&params->deviceinfo);
ptp_free_deviceinfo (&params->deviceinfo);
C_PTP (ptp_getdeviceinfo(params, &params->deviceinfo));
CR (fixup_cached_deviceinfo (camera, &params->deviceinfo));
C_PTP (ptp_canon_eos_getstorageids(params, &sids));
Expand Down
6 changes: 1 addition & 5 deletions camlibs/ptp2/fujiptpip.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,11 @@

#include "ptp.h"
#include "ptp-private.h"
#include "ptp-bugs.h"

#define PTPIP_VERSION_MAJOR 0x0001
#define PTPIP_VERSION_MINOR 0x0000

#include "ptp.h"
#include "ptp-bugs.h"

#include "ptp-pack.c"

#define fujiptpip_len 0
#define fujiptpip_type 4 /* not always present */

Expand Down
7 changes: 3 additions & 4 deletions camlibs/ptp2/library.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include "ptp.h"
#include "ptp-bugs.h"
#include "ptp-private.h"
#include "ptp-pack.c"
#include "olympus-wrap.h"

#ifdef HAVE_LIBWS232
Expand Down Expand Up @@ -311,7 +310,7 @@ fixup_cached_deviceinfo (Camera *camera, PTPDeviceInfo *di) {


print_debug_deviceinfo (params, &newdi);
ptp_free_DI (di);
ptp_free_deviceinfo (di);
memcpy (di, &newdi, sizeof(newdi));
return GP_OK;
}
Expand Down Expand Up @@ -393,7 +392,7 @@ fixup_cached_deviceinfo (Camera *camera, PTPDeviceInfo *di) {
for (unsigned i=0;i<x.DevicePropertiesSupported_len;i++)
di->DevicePropertiesSupported[di->DevicePropertiesSupported_len + i] = x.DevicePropertiesSupported[i];
di->DevicePropertiesSupported_len += x.DevicePropertiesSupported_len;
ptp_free_EOS_DI (&x);
ptp_canon_eos_free_deviceinfo (&x);
}

LOG_ON_PTP_E (ptp_check_eos_events(params));
Expand Down Expand Up @@ -7998,7 +7997,7 @@ camera_summary (Camera* camera, CameraText* summary, GPContext *context)
APPEND_TXT ("\n");
ptp_free_devicepropdesc (&dpd);
}
ptp_free_DI (&pdi);
ptp_free_deviceinfo (&pdi);
return (GP_OK);
#undef SPACE_LEFT
#undef APPEND_TXT
Expand Down
2 changes: 1 addition & 1 deletion camlibs/ptp2/olympus-wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

#include "ptp.h"
#include "ptp-private.h"
#include "ptp-pack.c"
#include "olympus-wrap.h"
#include "ptp-pack.c" /* only for ptp_pack_OI */

#include <gphoto2/gphoto2-library.h>
#include <gphoto2/gphoto2-setting.h>
Expand Down
Loading
Loading