404

[ Avaa Bypassed ]




Upload:

Command:

botdev@3.129.209.135: ~ $
/// Remove unneeded conversion to bool
///
//# Relational and logical operators evaluate to bool,
//# explicit conversion is overly verbose and unneeded.
//
// Copyright: (C) 2016 Andrew F. Davis <afd@ti.com> GPLv2.

virtual patch
virtual context
virtual org
virtual report

//----------------------------------------------------------
//  For patch mode
//----------------------------------------------------------

@depends on patch@
expression A, B;
symbol true, false;
@@

(
  A == B
|
  A != B
|
  A > B
|
  A < B
|
  A >= B
|
  A <= B
|
  A && B
|
  A || B
)
- ? true : false

//----------------------------------------------------------
//  For context mode
//----------------------------------------------------------

@r depends on !patch@
expression A, B;
symbol true, false;
position p;
@@

(
  A == B
|
  A != B
|
  A > B
|
  A < B
|
  A >= B
|
  A <= B
|
  A && B
|
  A || B
)
* ? true : false@p

//----------------------------------------------------------
//  For org mode
//----------------------------------------------------------

@script:python depends on r&&org@
p << r.p;
@@

msg = "WARNING: conversion to bool not needed here"
coccilib.org.print_todo(p[0], msg)

//----------------------------------------------------------
//  For report mode
//----------------------------------------------------------

@script:python depends on r&&report@
p << r.p;
@@

msg = "WARNING: conversion to bool not needed here"
coccilib.report.print_report(p[0], msg)

Filemanager

Name Type Size Permission Actions
array_size.cocci File 1.66 KB 0644
badty.cocci File 1.68 KB 0644
boolconv.cocci File 1.44 KB 0644
boolinit.cocci File 2.2 KB 0644
boolreturn.cocci File 698 B 0644
bugon.cocci File 1.45 KB 0644
cond_no_effect.cocci File 2.04 KB 0644
cstptr.cocci File 827 B 0644
doubleinit.cocci File 1.36 KB 0644
ifaddr.cocci File 659 B 0644
ifcol.cocci File 1.21 KB 0644
irqf_oneshot.cocci File 1.91 KB 0644
noderef.cocci File 1.17 KB 0644
of_table.cocci File 1.33 KB 0644
orplus.cocci File 1 KB 0644
returnvar.cocci File 1.22 KB 0644
semicolon.cocci File 1.04 KB 0644
warn.cocci File 1.62 KB 0644