Skip to content

Commit

Permalink
ptp2: use hex format in debug output for GenericTable enum lookups
Browse files Browse the repository at this point in the history
We use hex format for the same information in other parts of the log file.
  • Loading branch information
axxel authored and msmeissn committed Sep 27, 2024
1 parent 5b7f7c1 commit 02b7509
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions camlibs/ptp2/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,30 +848,30 @@ _put_Generic##bits##Table(CONFIG_PUT_ARGS, struct deviceproptable##bits * tbl, i
if (dpd->FormFlag & PTP_DPFF_Enumeration) { \
for (j = 0; j<dpd->FORM.Enum.NumberOfValues; j++) { \
if (bits##val == dpd->FORM.Enum.SupportedValue[j].bits) { \
GP_LOG_D ("FOUND right value for %s in the enumeration at val %d", value, bits##val); \
GP_LOG_D ("FOUND right value for %s in the enumeration at val %04x", value, bits##val); \
propval->bits = bits##val; \
return GP_OK; \
} \
} \
GP_LOG_D ("did not find the right value for %s in the enumeration at val %d... continuing", value, bits##val); \
GP_LOG_D ("did not find the right value for %s in the enumeration at val %04x... continuing", value, bits##val); \
/* continue looking, but with this value as fallback */ \
} else { \
GP_LOG_D ("not an enumeration ... return %s as %d", value, bits##val); \
GP_LOG_D ("not an enumeration ... return %s as %04x", value, bits##val); \
propval->bits = bits##val; \
return GP_OK; \
} \
} \
} \
if (foundvalue) { \
GP_LOG_D ("Using fallback, not found in enum... return %s as %d", value, bits##val); \
GP_LOG_D ("Using fallback, not found in enum... return %s as %04x", value, bits##val); \
propval->bits = bits##val; \
return GP_OK; \
} \
if (!sscanf(value, _("Unknown value %04x"), &intval)) { \
GP_LOG_E ("failed to find value %s in list", value); \
return GP_ERROR; \
} \
GP_LOG_D ("Using fallback, not found in enum... return %s as %d", value, bits##val); \
GP_LOG_D ("Using fallback, not found in enum... return %s as %04x", value, bits##val); \
propval->bits = intval; \
return GP_OK; \
}
Expand Down

0 comments on commit 02b7509

Please sign in to comment.