Project

General

Profile

Cleanup #20698

Constants in code should be replaced with MACRO

Added by Amit Kumar over 6 years ago. Updated over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

I found huge number of constants in code.
In future if we want to change the comparison statement, we need to go to every file and change it.
Macro at common place may be common/config.h would be good.

Doing this for module ceph/src/os

History

#1 Updated by Jos Collin over 6 years ago

  • Tracker changed from Bug to Cleanup

#2 Updated by Kefu Chai over 6 years ago

please be specific. in the case of your PR of https://github.com/ceph/ceph/pull/16447, replacing 1 with VAL1 does not help at all.

if 1 is a magic number, for example, which is a sentry of a number sequence. we need to have a better name for it. but in this case, it's not.

#3 Updated by Amit Kumar over 6 years ago

Variable name can be changed!!! your suggestions would be good..
But using constant in code ... I believe is no Good..

#4 Updated by Kefu Chai over 6 years ago

But using constant in code ... I believe is no Good..

constant in code is not necessary a bad smell.

Also available in: Atom PDF