halt='declare loop iterators outside the for statement' \
$(_sc_search_regexp)
+# Use 'bool', not 'int', when assigning true or false
+sc_prohibit_int_assign_bool:
+ @prohibit='\<int\>.*= *(true|false)' \
+ halt='use bool type for boolean values' \
+ $(_sc_search_regexp)
+
# Many of the function names below came from this filter:
# git grep -B2 '\<_('|grep -E '\.c- *[[:alpha:]_][[:alnum:]_]* ?\(.*[,;]$' \
# |sed 's/.*\.c- *//'|perl -pe 's/ ?\(.*//'|sort -u \
virDomainSnapshotDefPtr def = *defptr;
int ret = -1;
int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
- int align_match = true;
+ bool align_match = true;
char uuidstr[VIR_UUID_STRING_BUFLEN];
virDomainSnapshotObjPtr other;
struct stat sb;
int idx;
int format;
- int activeFail = false;
+ bool activeFail = false;
virQEMUDriverConfigPtr cfg = NULL;
char *alias = NULL;
char *buf = NULL;
unsigned int parse_flags = VIR_DOMAIN_SNAPSHOT_PARSE_DISKS;
virDomainSnapshotObjPtr other = NULL;
int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
- int align_match = true;
+ bool align_match = true;
virQEMUDriverConfigPtr cfg = NULL;
virCapsPtr caps = NULL;
unsigned int flags)
{
int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
- int align_match = true;
+ bool align_match = true;
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) {
align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
virCgroupSupportsCpuBW(virCgroupPtr cgroup)
{
char *path = NULL;
- int ret = false;
+ bool ret = false;
if (!cgroup)
return false;
const char *stubDriverName)
{
int result = -1;
- int reprobe = false;
+ bool reprobe = false;
char *stubDriverPath = NULL;
char *driverLink = NULL;
char *path = NULL; /* reused for different purposes */
{
char *scsi_host_path = NULL;
char *fc_host_path = NULL;
- int ret = false;
+ bool ret = false;
if (virAsprintf(&fc_host_path,
"%s/host%d/%s",
virDomainMemoryStatStruct stats[VIR_DOMAIN_MEMORY_STAT_NR];
unsigned int nr_stats;
size_t i;
- int ret = false;
+ bool ret = false;
int rv = 0;
int period = -1;
bool config = vshCommandOptBool(cmd, "config");
const char *path = NULL;
unsigned long long size = 0;
unsigned int flags = 0;
- int ret = false;
+ bool ret = false;
if (vshCommandOptStringReq(ctl, cmd, "path", (const char **) &path) < 0)
return false;
virStreamPtr st = NULL;
unsigned int screen = 0;
unsigned int flags = 0; /* currently unused */
- int ret = false;
+ bool ret = false;
bool created = false;
bool generated = false;
char *mime = NULL;
cmdInjectNMI(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
- int ret = true;
+ bool ret = true;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
cmdSendKey(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
- int ret = false;
+ bool ret = false;
const char *codeset_option;
int codeset;
unsigned int holdtime = 0;
cmdSendProcessSignal(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
- int ret = false;
+ bool ret = false;
const char *pidstr;
const char *signame;
long long pid_value;
int diff_mac;
size_t i;
int ret;
- int functionReturn = false;
+ bool functionReturn = false;
unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT;
bool current = vshCommandOptBool(cmd, "current");
bool config = vshCommandOptBool(cmd, "config");