Project

General

Profile

Bug #19445

client: warning: ‘*’ in boolean context, suggest ‘&&’ instead #14263

Added by Jos Collin about 2 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Client
Target version:
-
Start date:
04/02/2017
Due date:
% Done:

0%

Source:
Community (dev)
Tags:
client SyntheticClient warning
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Release:
master
Needs Doc:
No

Description

The following warning appears during make. Here roll_die and empty() returns bool. This can be easily fixed by removing the value 0.9. But I think this can better be fixed by the person who wrote it, so that the below 'ascend' and 'descend' logic can be preserved.

SyntheticClient.cc: In member function int SyntheticClient::random_walk(int):
SyntheticClient.cc:2659:11: warning: * in boolean context, suggest && instead [-Wint-in-bool-context]
     if (.9*roll_die(::pow((double).9,(double)cwd.depth())) && !subdirs.empty()) {

    // ascend?                                                                                                                          
    if (cwd.depth() && !roll_die(::pow((double).9, (double)cwd.depth()))) {
      dout(DBL) << "die says up" << dendl;
      up();
      continue;
    }

    // descend?                                                                                                                         
    if (.9*roll_die(::pow((double).9,(double)cwd.depth())) && !subdirs.empty()) {
      string s = get_random_subdir();
      cwd.push_dentry( s );
      dout(DBL) << "cd " << s << " -> " << cwd << dendl;
      clear_dir();
      continue;
    }

History

#1 Updated by Brad Hubbard about 2 months ago

  • Status changed from New to In Progress
  • Assignee changed from Sage Weil to Brad Hubbard
  • Release master added

#2 Updated by Jos Collin about 2 months ago

  • Status changed from In Progress to Resolved

The PR#14308 is merged.

Also available in: Atom PDF