Stylistic change: move inline comments to column 32

This commit is contained in:
Joerg Wunsch
2024-04-19 22:43:57 +02:00
parent 2026142511
commit 76efcb614c

View File

@@ -55,11 +55,11 @@ static void swig_progress(int percent, double etime, const char *hdr, int finish
void set_msg_callback(PyObject *PyFunc) {
if (PyFunc == Py_None) {
if (msg_cb)
Py_XDECREF(msg_cb); // Remove reference to previous callback
Py_XDECREF(msg_cb); // Remove reference to previous callback
msg_cb = NULL;
} else {
if (msg_cb)
Py_XDECREF(msg_cb); // Remove reference to previous callback
Py_XDECREF(msg_cb); // Remove reference to previous callback
Py_XINCREF(PyFunc); // Add reference to new callback
msg_cb = PyFunc;
}
@@ -111,10 +111,10 @@ int avrdude_message2(FILE *fp, int lno, const char *file,
rc = vsnprintf(NULL, 0, format, ap);
va_end(ap);
if (rc < 0) // Some errror?
if (rc < 0) // Some errror?
return 0;
rc++; // Accommodate terminating nul
rc++; // Accommodate terminating nul
char *p = cfg_malloc(__func__, rc);
va_start(ap, format);
rc = vsnprintf(p, rc, format, ap);
@@ -258,26 +258,26 @@ typedef struct programmer_t PROGRAMMER;
typedef void pgm_initpgm(PROGRAMMER*);
enum msglvl {
MSG_EXT_ERROR = (-3), // OS-type error, no -v option, can be suppressed with -qqqqq
MSG_ERROR = (-2), // Avrdude error, no -v option, can be suppressed with -qqqq
MSG_WARNING = (-1), // Warning, no -v option, can be suppressed with -qqq
MSG_INFO = 0, // Commentary, no -v option, can be suppressed with -qq
MSG_NOTICE = 1, // Displayed with -v
MSG_NOTICE2 = 2, // Displayed with -vv
MSG_DEBUG = 3, // Displayed with -vvv
MSG_TRACE = 4, // Displayed with -vvvv, show trace communication
MSG_TRACE2 = 5, // Displayed with -vvvvv
MSG_EXT_ERROR = (-3), // OS-type error, no -v option, can be suppressed with -qqqqq
MSG_ERROR = (-2), // Avrdude error, no -v option, can be suppressed with -qqqq
MSG_WARNING = (-1), // Warning, no -v option, can be suppressed with -qqq
MSG_INFO = 0, // Commentary, no -v option, can be suppressed with -qq
MSG_NOTICE = 1, // Displayed with -v
MSG_NOTICE2 = 2, // Displayed with -vv
MSG_DEBUG = 3, // Displayed with -vvv
MSG_TRACE = 4, // Displayed with -vvvv, show trace communication
MSG_TRACE2 = 5, // Displayed with -vvvvv
};
enum msgmode {
MSG2_PROGNAME = 1, // Start by printing progname
MSG2_FUNCTION = 2, // Print calling function (1st arg) after progname if >= notice
MSG2_FILELINE = 4, // Print source file and line number after function if >= debug
MSG2_TYPE = 8, // Print message type after function or progname
MSG2_INDENT1 = 16, // Start by printing indentation of progname+1 blanks
MSG2_INDENT2 = 32, // Start by printing indentation of progname+2 blanks
MSG2_FLUSH = 64, // Flush before and after printing
MSG2_LEFT_MARGIN = 128, // Print \n unless last character printed was \n
MSG2_PROGNAME = 1, // Start by printing progname
MSG2_FUNCTION = 2, // Print calling function (1st arg) after progname if >= notice
MSG2_FILELINE = 4, // Print source file and line number after function if >= debug
MSG2_TYPE = 8, // Print message type after function or progname
MSG2_INDENT1 = 16, // Start by printing indentation of progname+1 blanks
MSG2_INDENT2 = 32, // Start by printing indentation of progname+2 blanks
MSG2_FLUSH = 64, // Flush before and after printing
MSG2_LEFT_MARGIN = 128, // Print \n unless last character printed was \n
};
// Functions to record a callback
@@ -303,14 +303,14 @@ void set_progress_callback(PyObject *PyFunc);
%immutable;
typedef struct avrpart {
const char * desc; /* long part name */
const char * id; /* short part name */
LISTID variants; /* String with variant name and chip properties */
const char * parent_id; /* Used by developer options */
const char * family_id; /* family id in the SIB (avr8x) */
int prog_modes; /* Programming interfaces, see #define PM_... */
unsigned char signature[3]; /* expected value of signature bytes */
unsigned short usbpid; /* USB DFU product ID (0 = none) */
const char * desc; /* long part name */
const char * id; /* short part name */
LISTID variants; /* String with variant name and chip properties */
const char * parent_id; /* Used by developer options */
const char * family_id; /* family id in the SIB (avr8x) */
int prog_modes; /* Programming interfaces, see #define PM_... */
unsigned char signature[3]; /* expected value of signature bytes */
unsigned short usbpid; /* USB DFU product ID (0 = none) */
LISTID mem; /* avr memory definitions */
LISTID mem_alias; /* memory alias definitions */
const char * config_file; /* config file where defined */
@@ -321,21 +321,21 @@ typedef struct avrpart {
typedef unsigned int memtype_t;
typedef struct avrmem {
%immutable;
const char *desc; /* memory description ("flash", "eeprom", etc) */
memtype_t type; /* internally used type, cannot be set in conf files */
bool paged; /* 16-bit page addressed, e.g., ATmega flash but not EEPROM */
int size; /* total memory size in bytes */
int page_size; /* size of memory page (if page addressed) */
int num_pages; /* number of pages (if page addressed) */
int initval; /* factory setting of fuses and lock bits */
int bitmask; /* bits used in fuses and lock bits */
const char *desc; /* memory description ("flash", "eeprom", etc) */
memtype_t type; /* internally used type, cannot be set in conf files */
bool paged; /* 16-bit page addressed, e.g., ATmega flash but not EEPROM */
int size; /* total memory size in bytes */
int page_size; /* size of memory page (if page addressed) */
int num_pages; /* number of pages (if page addressed) */
int initval; /* factory setting of fuses and lock bits */
int bitmask; /* bits used in fuses and lock bits */
%mutable;
unsigned char * buf; /* pointer to memory buffer */
unsigned char * buf; /* pointer to memory buffer */
} AVRMEM;
%immutable;
typedef struct avrmem_alias {
const char *desc; /* alias name ("syscfg0" etc.) */
const char *desc; /* alias name ("syscfg0" etc.) */
AVRMEM *aliased_mem;
} AVRMEM_ALIAS;
%mutable;
@@ -599,12 +599,12 @@ int read_config(const char * file);
extern LISTID part_list;
extern LISTID programmers;
LNODEID lfirst ( LISTID ); /* head of the list */
LNODEID llast ( LISTID ); /* tail of the list */
LNODEID lnext ( LNODEID ); /* next item in the list */
LNODEID lprev ( LNODEID ); /* previous item in the list */
void * ldata ( LNODEID ); /* data at the current position */
int lsize ( LISTID ); /* number of elements in the list */
LNODEID lfirst ( LISTID ); /* head of the list */
LNODEID llast ( LISTID ); /* tail of the list */
LNODEID lnext ( LNODEID ); /* next item in the list */
LNODEID lprev ( LNODEID ); /* previous item in the list */
void * ldata ( LNODEID ); /* data at the current position */
int lsize ( LISTID ); /* number of elements in the list */
// Typecast helpers to interpret LNODEID
%feature("autodoc", "LNODEID -> PROGRAMMER*") ldata_programmer;