mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-07-18 23:49:26 +03:00
Declare const char * pointers as such
This commit is contained in:
@@ -591,7 +591,7 @@ const char *str_plural(int x) {
|
||||
static const char *str_filename(const char *fn, const char *stdname) {
|
||||
if(!fn)
|
||||
fn = "???";
|
||||
char *p1 = strrchr(fn, '/'), *p2 = strrchr(fn, '\\');
|
||||
const char *p1 = strrchr(fn, '/'), *p2 = strrchr(fn, '\\');
|
||||
|
||||
return str_eq(fn, "-")? stdname: str_starts(fn, "/dev/")? fn: p1? p1 + 1: p2? p2 + 1: fn;
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ static int check_for_port_argument_match(const char *port, const char *bus,
|
||||
|
||||
if(str_casestarts(port, "usb:")) {
|
||||
port += 4;
|
||||
char *dev_name = strchr(port, ':');
|
||||
const char *dev_name = strchr(port, ':');
|
||||
|
||||
if(dev_name) // Compare with busdir:devicefile
|
||||
return str_busdev_eq(port, bus) && str_busdev_eq(dev_name+1, device);
|
||||
|
||||
@@ -968,7 +968,7 @@ static int xbeedev_open(const char *port, union pinfo pinfo, union filedescripto
|
||||
*
|
||||
* ... for a direct connection.
|
||||
*/
|
||||
char *ttySeparator = strchr(port, '@');
|
||||
const char *ttySeparator = strchr(port, '@');
|
||||
|
||||
if(ttySeparator == NULL) {
|
||||
pmsg_error("XBee: bad port syntax, require <xbee-address>@<serial-device>\n");
|
||||
@@ -979,7 +979,7 @@ static int xbeedev_open(const char *port, union pinfo pinfo, union filedescripto
|
||||
|
||||
XBeeBootSessionInit(xbs);
|
||||
|
||||
char *tty = &ttySeparator[1];
|
||||
const char *tty = ttySeparator + 1;
|
||||
|
||||
if(ttySeparator == port) {
|
||||
// Direct connection
|
||||
@@ -1073,8 +1073,7 @@ static int xbeedev_open(const char *port, union pinfo pinfo, union filedescripto
|
||||
pmsg_notice("baud %ld\n", (long) pinfo.serialinfo.baud);
|
||||
|
||||
{
|
||||
const int rc = xbs->serialDevice->open(tty, pinfo,
|
||||
&xbs->serialDescriptor);
|
||||
const int rc = xbs->serialDevice->open(tty, pinfo, &xbs->serialDescriptor);
|
||||
|
||||
if(rc < 0) {
|
||||
mmt_free(xbs);
|
||||
|
||||
Reference in New Issue
Block a user