mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-09-30 04:49:14 +03:00
Replace strcasecmp with str_caseeq
This commit is contained in:
@@ -47,7 +47,7 @@ int upidxsig(const uint8_t *sigs) {
|
||||
// Given the long name of a part return index in uP table or -1 if not found
|
||||
int upidxname(const char *name) {
|
||||
for(size_t i=0; i < sizeof uP_table/sizeof *uP_table; i++)
|
||||
if(0 == strcasecmp(name, uP_table[i].name))
|
||||
if(str_caseeq(name, uP_table[i].name))
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
|
||||
@@ -342,11 +342,11 @@ buspirate_parseextparms(const PROGRAMMER *pgm, const LISTID extparms) {
|
||||
char *resetpin;
|
||||
while ((resetpin = strtok(preset, ","))) {
|
||||
preset = NULL; /* for subsequent strtok() calls */
|
||||
if (strcasecmp(resetpin, "cs") == 0)
|
||||
if (str_caseeq(resetpin, "cs"))
|
||||
PDATA(pgm)->reset |= BP_RESET_CS;
|
||||
else if (strcasecmp(resetpin, "aux") == 0 || strcasecmp(reset, "aux1") == 0)
|
||||
else if (str_caseeq(resetpin, "aux") || str_caseeq(reset, "aux1"))
|
||||
PDATA(pgm)->reset |= BP_RESET_AUX;
|
||||
else if (strcasecmp(resetpin, "aux2") == 0)
|
||||
else if (str_caseeq(resetpin, "aux2"))
|
||||
PDATA(pgm)->reset |= BP_RESET_AUX2;
|
||||
else {
|
||||
pmsg_error("reset must be either CS or AUX\n");
|
||||
|
||||
@@ -939,7 +939,7 @@ void cfg_update_mcuid(AVRPART *part) {
|
||||
|
||||
// Find an entry that shares the same name, overwrite mcuid with known, existing mcuid
|
||||
for(size_t i=0; i < sizeof uP_table/sizeof *uP_table; i++) {
|
||||
if(strcasecmp(part->desc, uP_table[i].name) == 0) {
|
||||
if(str_caseeq(part->desc, uP_table[i].name)) {
|
||||
if(part->mcuid != (int) uP_table[i].mcuid) {
|
||||
if(part->mcuid >= 0 && verbose >= MSG_DEBUG)
|
||||
yywarning("overwriting mcuid of part %s to be %d", part->desc, uP_table[i].mcuid);
|
||||
|
||||
@@ -118,7 +118,7 @@ const PROGRAMMER_TYPE programmers_types[] = { // Name(s) the programmers call th
|
||||
|
||||
const PROGRAMMER_TYPE *locate_programmer_type(const char *id) {
|
||||
for(size_t i = 0; i < sizeof programmers_types/sizeof*programmers_types; i++)
|
||||
if(strcasecmp(id, programmers_types[i].id) == 0)
|
||||
if(str_caseeq(id, programmers_types[i].id))
|
||||
return programmers_types + i;
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -981,9 +981,9 @@ static int serialupdi_parseextparms(const PROGRAMMER *pgm, const LISTID extparms
|
||||
extended_param = ldata(ln);
|
||||
|
||||
if (sscanf(extended_param, "rtsdtr=%4s", rts_mode) == 1) {
|
||||
if (strcasecmp(rts_mode, "low") == 0) {
|
||||
if (str_caseeq(rts_mode, "low")) {
|
||||
updi_set_rts_mode(pgm, RTS_MODE_LOW);
|
||||
} else if (strcasecmp(rts_mode, "high") == 0) {
|
||||
} else if (str_caseeq(rts_mode, "high")) {
|
||||
updi_set_rts_mode(pgm, RTS_MODE_HIGH);
|
||||
} else {
|
||||
pmsg_error("RTS/DTR mode must be LOW or HIGH\n");
|
||||
|
||||
@@ -179,7 +179,7 @@ static int usbdev_open(const char *port, union pinfo pinfo, union filedescriptor
|
||||
* right-to-left.
|
||||
*/
|
||||
x = strlen(string) - strlen(serno);
|
||||
if (strcasecmp(string + x, serno) != 0)
|
||||
if (!str_caseeq(string + x, serno))
|
||||
{
|
||||
pmsg_debug("usbdev_open(): serial number does not match\n");
|
||||
usb_close(udev);
|
||||
|
||||
@@ -561,7 +561,7 @@ static int usbasp_open(PROGRAMMER *pgm, const char *port) {
|
||||
/* try alternatives */
|
||||
if(str_eq(pgmid, "usbasp")) {
|
||||
/* for id usbasp autodetect some variants */
|
||||
if(strcasecmp(port, "nibobee") == 0) {
|
||||
if(str_caseeq(port, "nibobee")) {
|
||||
pmsg_error("using -C usbasp -P nibobee is deprecated, use -C nibobee instead\n");
|
||||
if (usbOpenDevice(&PDATA(pgm)->usbhandle, USBASP_NIBOBEE_VID, "www.nicai-systems.com",
|
||||
USBASP_NIBOBEE_PID, "NIBObee") != 0) {
|
||||
|
||||
Reference in New Issue
Block a user