Skip to content

Commit

Permalink
Fixed function name plsr_set_expose_compensation -> pslr
Browse files Browse the repository at this point in the history
Fixed a few sign-unsigned comparison issues
  • Loading branch information
karlrees committed Aug 13, 2021
1 parent 12bb0fb commit 2a53d1a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pktriggercord-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int save_buffer(pslr_handle_t camhandle, int bufno, int fd, pslr_status *status,
DPRINT("write(buf): Nothing has been written to buf.\n");
} else if (r == -1) {
perror("write(buf)");
} else if (r < bytes) {
} else if ((uint32_t)r < bytes) {
DPRINT("write(buf): only write %zu bytes, should be %d bytes.\n", r, bytes);
}
current += bytes;
Expand Down Expand Up @@ -182,7 +182,7 @@ void save_memory(pslr_handle_t camhandle, int fd, uint32_t length) {
DPRINT("write(buf): Nothing has been written to buf.\n");
} else if (r == -1) {
perror("write(buf)");
} else if (r < bytes) {
} else if ((uint32_t)r < bytes) {
DPRINT("write(buf): only write %zu bytes, should be %d bytes.\n", r, bytes);
}
current += bytes;
Expand Down Expand Up @@ -897,7 +897,7 @@ int main(int argc, char **argv) {
}

if ( ec.denom ) {
plsr_set_expose_compensation( camhandle, ec );
pslr_set_expose_compensation( camhandle, ec );
}

if ( fec.denom ) {
Expand Down
2 changes: 1 addition & 1 deletion pktriggercord.c
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ G_MODULE_EXPORT void ec_scale_value_changed_cb(GtkAction *action, gpointer user_
return;
}
if (status_new->ec.nom != new_ec.nom || status_new->ec.denom != new_ec.denom) {
ret = plsr_set_expose_compensation(camhandle, new_ec);
ret = pslr_set_expose_compensation(camhandle, new_ec);
if (ret != PSLR_OK) {
DPRINT("Set EC failed: %d\n", ret);
}
Expand Down
6 changes: 3 additions & 3 deletions pslr.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ pslr_handle_t pslr_init( char *model, char *device ) {
char **drives;
const char *camera_name;

DPRINT("[C]\tplsr_init()\n");
DPRINT("[C]\tpslr_init()\n");

if ( device == NULL ) {
drives = get_drives(&driveNum);
Expand Down Expand Up @@ -741,8 +741,8 @@ int pslr_set_iso(pslr_handle_t h, uint32_t value, uint32_t auto_min_value, uint3
return ipslr_handle_command_x18( p, true, X18_ISO, 3, value, auto_min_value, auto_max_value);
}

int plsr_set_expose_compensation(pslr_handle_t h, pslr_rational_t value) {
DPRINT("[C]\tplsr_set_expose_compensation(0x%X 0x%X)\n", value.nom, value.denom);
int pslr_set_expose_compensation(pslr_handle_t h, pslr_rational_t value) {
DPRINT("[C]\tpslr_set_expose_compensation(0x%X 0x%X)\n", value.nom, value.denom);
ipslr_handle_t *p = (ipslr_handle_t *) h;
return ipslr_handle_command_x18( p, true, X18_EC, 2, value.nom, value.denom, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion pslr.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int pslr_set_progress_callback(pslr_handle_t h, pslr_progress_callback_t cb,
int pslr_set_shutter(pslr_handle_t h, pslr_rational_t value);
int pslr_set_aperture(pslr_handle_t h, pslr_rational_t value);
int pslr_set_iso(pslr_handle_t h, uint32_t value, uint32_t auto_min_value, uint32_t auto_max_value);
int plsr_set_expose_compensation(pslr_handle_t h, pslr_rational_t value);
int pslr_set_expose_compensation(pslr_handle_t h, pslr_rational_t value);

int pslr_set_white_balance(pslr_handle_t h, pslr_white_balance_mode_t wb_mode);
int pslr_set_white_balance_adjustment(pslr_handle_t h, pslr_white_balance_mode_t wb_mode, uint32_t wbadj_mg, uint32_t wbadj_ba);
Expand Down
2 changes: 1 addition & 1 deletion pslr_scsi_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ int scsi_read(int sg_fd, uint8_t *cmd, uint32_t cmdLen,

/* Older Pentax DSLR will report all bytes remaining, so make
* a special case for this (treat it as all bytes read). */
if (io.resid == bufLen) {
if ((uint32_t)io.resid == bufLen) {
return bufLen;
} else {
return bufLen - io.resid;
Expand Down

0 comments on commit 2a53d1a

Please sign in to comment.