V523. The 'then' statement is equivalent to the 'else' statement.
V523 The 'then' statement is equivalent to the 'else' statement. GridCtrl gridcellbase.cpp 652
BOOL CGridCellBase::PrintCell(....)
{
....
if(IsFixed())
crFG = (GetBackClr() != CLR_DEFAULT) ?
GetTextClr() : pDefaultCell->GetTextClr();
else
crFG = (GetBackClr() != CLR_DEFAULT) ?
GetTextClr() : pDefaultCell->GetTextClr();
....
}
V523 The 'then' statement is equivalent to the 'else' statement. tabbar.cpp 1085
void TabBarPlus::drawItem(
DRAWITEMSTRUCT *pDrawItemStruct)
{
....
if (!_isVertical)
Flags |= DT_BOTTOM;
else
Flags |= DT_BOTTOM;
....
}
Most likely this is what should be written here: Flags |= DT_VCENTER;
V523 The 'then' statement is equivalent to the 'else' statement. aac_enc aac_enc_api_fp.c 1379
AACStatus aacencGetFrame(....)
{
....
if (maxEn[0] > maxEn[1]) {
ics[1].num_window_groups = ics[0].num_window_groups;
for (g = 0; g < ics[0].num_window_groups; g++) {
ics[1].len_window_group[g] = ics[0].len_window_group[g];
}
} else {
ics[1].num_window_groups = ics[0].num_window_groups;
for (g = 0; g < ics[0].num_window_groups; g++) {
ics[1].len_window_group[g] = ics[0].len_window_group[g];
}
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. h264_dec umc_h264_segment_decoder_deblocking_mbaff.cpp 340
void H264SegmentDecoder::ResetDeblockingVariablesMBAFF()
{
....
if (GetMBFieldDecodingFlag(....))
m_deblockingParams.nNeighbour[HORIZONTAL_DEBLOCKING] =
m_CurMBAddr - mb_width * 2;
else
m_deblockingParams.nNeighbour[HORIZONTAL_DEBLOCKING] =
m_CurMBAddr - mb_width * 2;
....
}
Most likely this is what should be written at end: mb_width * 2 + 1;
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. Qt3Support q3datetimeedit.cpp 2170
QString Q3TimeEdit::sectionFormattedText(int sec)
{
....
if (d->typing && sec == d->ed->focusSection())
d->ed->setSectionSelection(sec, offset - txt.length(),
offset);
else
d->ed->setSectionSelection(sec, offset - txt.length(),
offset);
....
}
V523 The 'then' statement is equivalent to the 'else' statement. LLVMInstCombine instcombineandorxor.cpp 1387
static bool CollectBSwapParts(....) {
....
unsigned DestByteNo = InputByteNo + OverallLeftShift;
if (InputByteNo < ByteValues.size()/2) {
if (ByteValues.size()-1-DestByteNo != InputByteNo)
return true;
} else {
if (ByteValues.size()-1-DestByteNo != InputByteNo)
return true;
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. clangRewrite rewriteobjc.cpp 4181
std::string RewriteObjC::SynthesizeBlockFunc(....)
{
....
if (convertBlockPointerToFunctionPointer(QT))
QT.getAsStringInternal(ParamStr, Context->PrintingPolicy);
else
QT.getAsStringInternal(ParamStr, Context->PrintingPolicy);
....
}
V523 The 'then' statement is equivalent to the 'else' statement. cardlib cardbutton.cpp 83
void CardButton::DrawRect(HDC hdc, RECT *rect, bool fNormal)
{
....
HPEN hhi = CreatePen(0, 0, MAKE_PALETTERGB(crHighlight));
HPEN hsh = CreatePen(0, 0, MAKE_PALETTERGB(crShadow));
....
if(fNormal)
hOld = SelectObject(hdc, hhi);
else
hOld = SelectObject(hdc, hhi);
....
}
Most likely this is what should be written here: else hOld = SelectObject(hdc, hsh);
V523 The 'then' statement is equivalent to the 'else' statement. me umc_me.cpp 3547
Ipp32s MeVC1::GetAcCoeffSize(....)
{
if(luma)
tblSet = (MeACTablesSet*)&ACTablesSet[
CodingSetsInter[m_cur.qp8][m_cur.AcTableIndex]];
else
tblSet = (MeACTablesSet*)&ACTablesSet[
CodingSetsInter[m_cur.qp8][m_cur.AcTableIndex]];
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. ACE throughput_stats.cpp 31
ACE_Throughput_Stats::sample (ACE_UINT64 throughput,
ACE_UINT64 latency)
{
this->ACE_Basic_Stats::sample (latency);
if (this->samples_count () == 1u)
{
this->throughput_last_ = throughput;
}
else
{
this->throughput_last_ = throughput;
}
}
V523 The 'then' statement is equivalent to the 'else' statement. clangRewrite rewriteobjc.cpp 3361
std::string RewriteObjC::SynthesizeBlockFunc(....)
{
....
if (convertBlockPointerToFunctionPointer(QT))
QT.getAsStringInternal(ParamStr,
Context->getPrintingPolicy());
else
QT.getAsStringInternal(ParamStr,
Context->getPrintingPolicy());
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. LLVMInstCombine instcombineandorxor.cpp 1368
static bool CollectBSwapParts(....)
{
....
unsigned DestByteNo = InputByteNo + OverallLeftShift;
if (InputByteNo < ByteValues.size()/2) {
if (ByteValues.size()-1-DestByteNo != InputByteNo)
return true;
} else {
if (ByteValues.size()-1-DestByteNo != InputByteNo)
return true;
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. bf_ikplugin generalmatrixvector.h 268
EIGEN_DONT_INLINE static void run(....)
{
....
if ((size_t(lhs0+alignedStart)%sizeof(LhsPacket))==0)
for (Index i = alignedStart;i<alignedSize;i+=ResPacketSize)
pstore(&res[i],
pcj.pmadd(ploadu<LhsPacket>(&lhs0[i]),
ptmp0, pload<ResPacket>(&res[i])));
else
for (Index i = alignedStart;i<alignedSize;i+=ResPacketSize)
pstore(&res[i],
pcj.pmadd(ploadu<LhsPacket>(&lhs0[i]),
ptmp0, pload<ResPacket>(&res[i])));
....
}
V523 The 'then' statement is equivalent to the 'else' statement. ec_sccp.c 3216
int openreceivehandler(....)
{
....
int return_rtp = check_rtp_entry(ip);
if (return_rtp < 0) {
int return_value = populate_rtp_struct(return_rtp, ip,
passthrupartyid,
rtpport);
if(return_value == -1) {
return NULL;
}
} else {
int return_value = populate_rtp_struct(return_rtp, ip,
passthrupartyid,
rtpport);
if (return_value == -1) {
return NULL;
}
}
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. deco16ic.c 943
static DEVICE_START( deco16ic )
{
....
if (intf->split)
deco16ic->pf2_tilemap_16x16 =
tilemap_create_device(device, get_pf2_tile_info,
deco16_scan_rows, 16, 16, fullwidth ?
64 : 32, fullheight ? 64 : 32);
else
deco16ic->pf2_tilemap_16x16 =
tilemap_create_device(device, get_pf2_tile_info,
deco16_scan_rows, 16, 16, fullwidth ?
64 : 32, fullheight ? 64 : 32);
....
}
V523 The 'then' statement is equivalent to the 'else' statement. resnet.c 628
int compute_res_net(int inputs, int channel,
const res_net_info *di)
{
....
if (OpenCol)
{
rTotal += 1.0 / di->rgb[channel].R[i];
v += vOL / di->rgb[channel].R[i];
}
else
{
rTotal += 1.0 / di->rgb[channel].R[i];
v += vOL / di->rgb[channel].R[i];
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. tpplib kerneldensityrtmixturedistr.cxx 104
bool KernelDensityRTMixtureDistr::recalc_RTstats(....)
{
....
if (catalog) {
tmp = (*run_RT_calc_)[i]->recalc_RTstats(
(*probs)[i], min_prob, (*ntts)[i], min_ntt, 2700);
}
else {
tmp = (*run_RT_calc_)[i]->recalc_RTstats(
(*probs)[i], min_prob, (*ntts)[i], min_ntt, 2700);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. vtkRendering vtkobjexporter.cxx 324
void vtkOBJExporter::WriteAnActor(....)
{
....
if (i%2)
{
i1 = i - 1;
i2 = i - 2;
}
else
{
i1 = i - 1;
i2 = i - 2;
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. reg_perfcount.c 1092
static uint32 reg_perfcount_get_perf_data_block(....)
{
....
if(object_ids == NULL)
{
/* we're getting a request for "Global" here */
retval = _reg_perfcount_assemble_global(block, mem_ctx,
base_index, names);
}
else
{
/* we're getting a request for a specific
set of PERF_OBJECT_TYPES */
retval = _reg_perfcount_assemble_global(block, mem_ctx,
base_index, names);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. cardbutton.cpp 86
void CardButton::DrawRect(HDC hdc, RECT *rect, bool fNormal)
{
....
if(fNormal)
hOld = SelectObject(hdc, hhi);
else
hOld = SelectObject(hdc, hhi);
....
}
V523 The 'then' statement is equivalent to the 'else' statement. pin_wavepci.cpp 562
NTSTATUS NTAPI
CPortPinWavePci::HandleKsStream(IN PIRP Irp)
{
....
if (m_Capture)
m_Position.WriteOffset += Data;
else
m_Position.WriteOffset += Data;
....
}
V523 The 'then' statement is equivalent to the 'else' statement. tab.c 1043
static void TAB_SetupScrolling(
TAB_INFO* infoPtr,
const RECT* clientRect)
{
....
/*
* Calculate the position of the scroll control.
*/
if(infoPtr->dwStyle & TCS_VERTICAL)
{
controlPos.right = clientRect->right;
controlPos.left = controlPos.right -
2 * GetSystemMetrics(SM_CXHSCROLL);
if (infoPtr->dwStyle & TCS_BOTTOM)
{
controlPos.top = clientRect->bottom -
infoPtr->tabHeight;
controlPos.bottom = controlPos.top +
GetSystemMetrics(SM_CYHSCROLL);
}
else
{
controlPos.bottom = clientRect->top + infoPtr->tabHeight;
controlPos.top = controlPos.bottom -
GetSystemMetrics(SM_CYHSCROLL);
}
}
else
{
controlPos.right = clientRect->right;
controlPos.left = controlPos.right -
2 * GetSystemMetrics(SM_CXHSCROLL);
if (infoPtr->dwStyle & TCS_BOTTOM)
{
controlPos.top = clientRect->bottom -
infoPtr->tabHeight;
controlPos.bottom = controlPos.top +
GetSystemMetrics(SM_CYHSCROLL);
}
else
{
controlPos.bottom = clientRect->top + infoPtr->tabHeight;
controlPos.top = controlPos.bottom -
GetSystemMetrics(SM_CYHSCROLL);
}
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. hw_oids.c 1043
NDIS_STATUS
Hw11QueryDiversitySelectionRX(
_In_ PHW_MAC_CONTEXT HwMac,
_In_ BOOLEAN SelectedPhy,
_In_ ULONG MaxEntries,
_Out_ PDOT11_DIVERSITY_SELECTION_RX_LIST
Dot11DiversitySelectionRXList
)
{
//
// Determine the PHY that the user wants to query
//
if (SelectedPhy)
return HwQueryDiversitySelectionRX(HwMac->Hw,
HwMac->SelectedPhyId,
MaxEntries,
Dot11DiversitySelectionRXList
);
else
return HwQueryDiversitySelectionRX(HwMac->Hw,
HwMac->SelectedPhyId,
MaxEntries,
Dot11DiversitySelectionRXList
);
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. aecm_core.c 1352
static int16_t CalcSuppressionGain(AecmCore_t * const aecm)
{
....
if (tmp16no1 < aecm->supGain)
{
aecm->supGain += (int16_t)((tmp16no1 - aecm->supGain) >> 4);
} else
{
aecm->supGain += (int16_t)((tmp16no1 - aecm->supGain) >> 4);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. skopedgebuilder.cpp 52
void SkOpEdgeBuilder::closeContour(const SkPoint& curveEnd,
const SkPoint& curveStart)
{
....
if (curveEnd.fX != curveStart.fX ||
curveEnd.fY != curveStart.fY)
{
fPathPts[fPathPts.count() - 1] = curveStart;
} else {
fPathPts[fPathPts.count() - 1] = curveStart;
} ....
}
V523 The 'then' statement is equivalent to the 'else' statement. cclientweapon.cpp 696
void CClientWeapon::DoGunShells ( CVector vecOrigin,
CVector vecDirection )
{
....
if ( GetAttachedTo () )
g_pGame->GetFx ()->TriggerGunshot (
NULL, vecOrigin, vecDirection, true );
else
g_pGame->GetFx ()->TriggerGunshot (
NULL, vecOrigin, vecDirection, true );
....
}
V523 The 'then' statement is equivalent to the 'else' statement. mzmlhandler.h 534
template <typename MapType>
void MzMLHandler<MapType>::characters(
const XMLCh* const chars, const XMLSize_t)
{
....
if (optionalAttributeAsString_(data_processing_ref,
attributes,
s_data_processing_ref))
{
data_.back().meta.setDataProcessing(
processing_[data_processing_ref]);
}
else
{
data_.back().meta.setDataProcessing(
processing_[data_processing_ref]);
}
....
}
Most likely this is what should be written here: processing_[data_processing_ref] ... processing_[default_processing_]
V523 The 'then' statement is equivalent to the 'else' statement. gamerules.cpp 5401
bool CGameRules::
ShouldGiveLocalPlayerHitableFee...OnCrosshairHoverForEntityClass
(const IEntityClass* pEntityClass) const
{
assert(pEntityClass != NULL);
if(gEnv->bMultiplayer)
{
return
(pEntityClass == s_pSmartMineClass) ||
(pEntityClass == s_pTurretClass) ||
(pEntityClass == s_pC4Explosive);
}
else
{
return
(pEntityClass == s_pSmartMineClass) ||
(pEntityClass == s_pTurretClass) ||
(pEntityClass == s_pC4Explosive);
}
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. hud_tape.cxx 267
void HUD::Tape::draw_vertical(float value)
{
....
if (_tick_length == VARIABLE) {
draw_line(_x, y, marker_xs, y);
draw_line(marker_xe, y, right, y);
} else {
draw_line(_x, y, marker_xs, y);
draw_line(marker_xe, y, right, y);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. LeicaDMIScopeInterface.cpp 1296
int LeicaScopeInterface::GetDICTurretInfo(....)
{
....
std::string tmp;
....
if (tmp == "DIC-TURRET")
scopeModel_->dicTurret_.SetMotorized(true);
else
scopeModel_->dicTurret_.SetMotorized(true);
....
}
V523 The 'then' statement is equivalent to the 'else' statement. taucs_scilab.c 700
static int uf_union (int* uf, int s, int t) {
if (uf_find(uf,s) < uf_find(uf,t))
{
uf[uf_find(uf,s)] = uf_find(uf,t);
return (uf_find(uf,t));
}
else
{
uf[uf_find(uf,s)] = uf_find(uf,t);
return (uf_find(uf,t));
}
}
V523 The 'then' statement is equivalent to the 'else' statement. dlglook1.c 873
int TmcCharacterLooks(pcmb)
CMB * pcmb;
{
....
if (qps < 0)
{
pcab->wCharQpsSpacing = -qps;
pcab->iCharIS = 2;
}
else if (qps > 0)
{
pcab->iCharIS = 1;
}
else
{
pcab->iCharIS = 0;
}
....
if (hps < 0)
{
pcab->wCharHpsPos = -hps;
pcab->iCharPos = 2;
}
else if (hps > 0)
{
pcab->iCharPos = 1;
}
else
{
pcab->iCharPos = 1;
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. paths.cpp 703
FString FPaths::CreateTempFilename( const TCHAR* Path,
const TCHAR* Prefix, const TCHAR* Extension )
{
....
const int32 PathLen = FCString::Strlen( Path );
if( PathLen > 0 && Path[ PathLen - 1 ] != TEXT('/') )
{
UniqueFilename =
FString::Printf( TEXT("%s/%s%s%s"), Path, Prefix,
*FGuid::NewGuid().ToString(), Extension );
}
else
{
UniqueFilename =
FString::Printf( TEXT("%s/%s%s%s"), Path, Prefix,
*FGuid::NewGuid().ToString(), Extension );
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. slatestyle.h 289
class SLATE_API FSlateStyleSet : public ISlateStyle
{
....
template< typename DefinitionType >
FORCENOINLINE void Set(....)
{
....
if ( DefinitionPtr == NULL )
{
WidgetStyleValues.Add( PropertyName,
MakeShareable(new DefinitionType(InStyleDefintion)) );
}
else
{
WidgetStyleValues.Add( PropertyName,
MakeShareable(new DefinitionType(InStyleDefintion)) );
}
}
....
};
V523 The 'then' statement is equivalent to the 'else' statement. qbluetoothservicediscoveryagent.cpp 402
void
QBluetoothServiceDiscoveryAgentPrivate::_q_deviceDiscovered(
const QBluetoothDeviceInfo &info)
{
if(mode == QBluetoothServiceDiscoveryAgent::FullDiscovery) {
for(int i = 0; i < discoveredDevices.count(); i++){
if(discoveredDevices.at(i).address() == info.address()){
discoveredDevices.removeAt(i);
}
}
discoveredDevices.prepend(info);
}
else {
for(int i = 0; i < discoveredDevices.count(); i++){
if(discoveredDevices.at(i).address() == info.address()){
discoveredDevices.removeAt(i);
}
}
discoveredDevices.prepend(info);
}
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. vp9_encodeframe.c 2450
static void encode_superblock(....)
{
if (mbmi->ref_frame[0] != LAST_FRAME)
cpi->zbin_mode_boost = GF_ZEROMV_ZBIN_BOOST;
else
cpi->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST;
....
}
V523 The 'then' statement is equivalent to the 'else' statement. aecm_core.c 1227
int16_t WebRtcAecm_CalcSuppressionGain(AecmCore_t * const aecm)
{
....
if (tmp16no1 < aecm->supGain)
{
aecm->supGain += (int16_t)((tmp16no1 - aecm->supGain) >> 4);
} else
{
aecm->supGain += (int16_t)((tmp16no1 - aecm->supGain) >> 4);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. filedlg.c 3302
static LRESULT FILEDLG95_LOOKIN_DrawItem(....)
{
if(pDIStruct->itemID == liInfos->uSelectedItem)
{
ilItemImage = (HIMAGELIST) SHGetFileInfoW (
(LPCWSTR) tmpFolder->pidlItem, 0, &sfi, sizeof (sfi),
shgfi_flags );
}
else
{
ilItemImage = (HIMAGELIST) SHGetFileInfoW (
(LPCWSTR) tmpFolder->pidlItem, 0, &sfi, sizeof (sfi),
shgfi_flags );
}
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. metadtitube.cxx 155
void MetaDTITube::
PrintInfo() const
{
MetaObject::PrintInfo();
METAIO_STREAM::cout << "ParentPoint = " << m_ParentPoint
<< METAIO_STREAM::endl;
if(m_Root)
{
METAIO_STREAM::cout << "Root = "
<< "True" << METAIO_STREAM::endl;
}
else
{
METAIO_STREAM::cout << "Root = "
<< "True" << METAIO_STREAM::endl;
}
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. kconfig_compiler.cpp 1051
QString newItem( const QString &type, ....)
{
QString t = "new "+cfg.inherits+"::Item" + ....;
if ( type == "Enum" ) t += ", values" + name;
if ( !defaultValue.isEmpty() ) {
t += ", ";
if ( type == "String" ) t += defaultValue; // <=
else t+= defaultValue; // <=
}
t += " );";
return t;
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. TabSRMM msglog.cpp 439
static void Build_RTF_Header()
{
....
if (dat->dwFlags & MWF_LOG_RTL)
AppendToBuffer(buffer, bufferEnd, bufferAlloced,
"{\\rtf1\\ansi\\deff0{\\fonttbl");
else
AppendToBuffer(buffer, bufferEnd, bufferAlloced,
"{\\rtf1\\ansi\\deff0{\\fonttbl");
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. cee_wks threadsuspend.cpp 2468
enum __MIDL___MIDL_itf_mscoree_0000_0004_0001
{
OPR_ThreadAbort = 0,
OPR_ThreadRudeAbortInNonCriticalRegion = .... ,
OPR_ThreadRudeAbortInCriticalRegion = ....) ,
OPR_AppDomainUnload = .... ,
OPR_AppDomainRudeUnload = ( OPR_AppDomainUnload + 1 ) ,
OPR_ProcessExit = ( OPR_AppDomainRudeUnload + 1 ) ,
OPR_FinalizerRun = ( OPR_ProcessExit + 1 ) ,
MaxClrOperation = ( OPR_FinalizerRun + 1 )
} EClrOperation;
void Thread::SetRudeAbortEndTimeFromEEPolicy()
{
LIMITED_METHOD_CONTRACT;
DWORD timeout;
if (HasLockInCurrentDomain())
{
timeout = GetEEPolicy()->
GetTimeout(OPR_ThreadRudeAbortInCriticalRegion); // <=
}
else
{
timeout = GetEEPolicy()->
GetTimeout(OPR_ThreadRudeAbortInCriticalRegion); // <=
}
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. mkntfs.c 1132
static int insert_positioned_attr_in_mft_record(....)
{
....
if (flags & ATTR_COMPRESSION_MASK) {
hdr_size = 72;
/* FIXME: This compression stuff is all wrong. .... */
/* now. (AIA) */
if (val_len)
mpa_size = 0; /* get_size_for_compressed_....; */
else
mpa_size = 0;
} else {
....
}
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. scroll_bar.cpp 57
void ScrollBar::_input_event(InputEvent p_event)
{
....
if (b.button_index==5 && b.pressed)
{
if (orientation==VERTICAL)
set_val( get_val() + get_page() / 4.0 );
else
set_val( get_val() + get_page() / 4.0 );
accept_event();
}
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. slatestyle.h 71
template< typename DefinitionType >
FORCENOINLINE void Set( .... )
{
....
if ( DefinitionPtr == nullptr )
{
WidgetStyleValues.Add( PropertyName,
MakeShareable( new DefinitionType( InStyleDefintion ) ) );
}
else
{
WidgetStyleValues.Add( PropertyName,
MakeShareable( new DefinitionType( InStyleDefintion ) ) );
}
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. viewproviderfemmesh.cpp 695
inline void insEdgeVec(std::map<int,std::set<int> > &map,
int n1, int n2)
{
if(n1<n2)
map[n2].insert(n1);
else
map[n2].insert(n1);
};
V523 The 'then' statement is equivalent to the 'else' statement. matrix_type.cc 312
DEFUN(....)
{
....
if (str_typ == "upper")
mattyp.mark_as_permuted(len, p);
else
mattyp.mark_as_permuted(len, p);
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. docparser.cpp 521
static void checkUndocumentedParams()
{
....
if (g_memberDef->inheritsDocsFrom())
{
warn_doc_error(g_memberDef->getDefFileName(),
g_memberDef->getDefLine(),
substitute(errMsg,"%","%%"));
}
else
{
warn_doc_error(g_memberDef->getDefFileName(),
g_memberDef->getDefLine(),
substitute(errMsg,"%","%%"));
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. translator_tw.h 769
class TranslatorChinesetraditional : public Translator
{
public:
....
virtual QCString trGeneratedFromFiles(bool single, ....)
{
....
QCString result=(QCString)"?";
....
if (single) result+=":"; else result+=":";
....
}
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. sofia_glue.c 552
char *sofia_overcome_sip_uri_weakness(....)
{
....
if (strchr(stripped, ';')) {
if (params) {
new_uri = switch_core_session_sprintf(session, "....",
uri_only ? "" : "<", stripped, sofia_glue_transport2str(
transport), params, uri_only ? "" : ">");
} else {
new_uri = switch_core_session_sprintf(session, "....",
uri_only ? "" : "<", stripped, sofia_glue_transport2str(
transport), uri_only ? "" : ">");
}
} else {
if (params) {
new_uri = switch_core_session_sprintf(session, "....",
uri_only ? "" : "<", stripped, sofia_glue_transport2str(
transport), params, uri_only ? "" : ">");
} else {
new_uri = switch_core_session_sprintf(session, "....",
uri_only ? "" : "<", stripped, sofia_glue_transport2str(
transport), uri_only ? "" : ">");
}
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. mozspelli18nmanager.cpp 34
NS_IMETHODIMP
mozSpellI18NManager::GetUtil(mozISpellI18NUtil **_retval, ....)
{
....
nsAutoString lang;
....
if(lang.EqualsLiteral("en"))
{
*_retval = new mozEnglishWordUtils;
}
else
{
*_retval = new mozEnglishWordUtils;
}
NS_IF_ADDREF(*_retval);
return NS_OK;
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. resource.c 661
WORD WINAPI GetDialog32Size16( LPCVOID dialog32 )
{
....
p = (const DWORD *)p + 1; /* x */
p = (const DWORD *)p + 1; /* y */
p = (const DWORD *)p + 1; /* cx */
p = (const DWORD *)p + 1; /* cy */
if (dialogEx)
p = (const DWORD *)p + 1; /* ID */
else
p = (const DWORD *)p + 1; /* ID */
....
}
V523 The 'then' statement is equivalent to the 'else' statement. lightrendering.cpp 864
void FDeferredShadingSceneRenderer::RenderLight(....)
{
....
if (bClearCoatNeeded)
{
SetShaderTemplLighting<false, false, false, true>(
RHICmdList, View, *VertexShader, LightSceneInfo);
}
else
{
SetShaderTemplLighting<false, false, false, true>(
RHICmdList, View, *VertexShader, LightSceneInfo);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. saint.c 2023
GLOBAL void siSMPRespRcvd(....)
{
....
if (agNULL == frameHandle)
{
/* indirect mode */
/* call back with success */
(*(ossaSMPCompletedCB_t)(pRequest->completionCB))(agRoot,
pRequest->pIORequestContext, OSSA_IO_SUCCESS, payloadSize,
frameHandle);
}
else
{
/* direct mode */
/* call back with success */
(*(ossaSMPCompletedCB_t)(pRequest->completionCB))(agRoot,
pRequest->pIORequestContext, OSSA_IO_SUCCESS, payloadSize,
frameHandle);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. smsat.c 2848
osGLOBAL void
smsatInquiryPage89(....)
{
....
if (oneDeviceData->satDeviceType == SATA_ATA_DEVICE)
{
pInquiry[40] = 0x01; /* LBA Low */
pInquiry[41] = 0x00; /* LBA Mid */
pInquiry[42] = 0x00; /* LBA High */
pInquiry[43] = 0x00; /* Device */
pInquiry[44] = 0x00; /* LBA Low Exp */
pInquiry[45] = 0x00; /* LBA Mid Exp */
pInquiry[46] = 0x00; /* LBA High Exp */
pInquiry[47] = 0x00; /* Reserved */
pInquiry[48] = 0x01; /* Sector Count */
pInquiry[49] = 0x00; /* Sector Count Exp */
}
else
{
pInquiry[40] = 0x01; /* LBA Low */
pInquiry[41] = 0x00; /* LBA Mid */
pInquiry[42] = 0x00; /* LBA High */
pInquiry[43] = 0x00; /* Device */
pInquiry[44] = 0x00; /* LBA Low Exp */
pInquiry[45] = 0x00; /* LBA Mid Exp */
pInquiry[46] = 0x00; /* LBA High Exp */
pInquiry[47] = 0x00; /* Reserved */
pInquiry[48] = 0x01; /* Sector Count */
pInquiry[49] = 0x00; /* Sector Count Exp */
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. agtiapi.c 829
#define osti_strtoul(nptr, endptr, base) \
strtoul((char *)nptr, (char **)endptr, 0)
if (osti_strncmp(buffer, "0x", 2) == 0)
{
maxTargets = osti_strtoul (buffer, &pLastUsedChar, 0);
AGTIAPI_PRINTK( ".... maxTargets = osti_strtoul 0 \n" );
}
else
{
maxTargets = osti_strtoul (buffer, &pLastUsedChar, 10);
AGTIAPI_PRINTK( ".... maxTargets = osti_strtoul 10\n" );
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. gtkprogressbar.c 1232
static void
gtk_progress_bar_act_mode_enter (GtkProgressBar *pbar)
{
....
/* calculate start pos */
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
if (!inverted)
{
priv->activity_pos = 0.0;
priv->activity_dir = 0;
}
else
{
priv->activity_pos = 1.0;
priv->activity_dir = 1;
}
}
else
{
if (!inverted)
{
priv->activity_pos = 0.0;
priv->activity_dir = 0;
}
else
{
priv->activity_pos = 1.0;
priv->activity_dir = 1;
}
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. dllmain.c 1325
SOCKET WSPAPI WSPAccept(....)
{
....
if (CallBack == CF_REJECT)
{
*lpErrno = WSAECONNREFUSED;
return INVALID_SOCKET;
}
else
{
*lpErrno = WSAECONNREFUSED;
return INVALID_SOCKET;
}
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. awt_ImagingLib.c 2927
static int expandPackedBCR(JNIEnv *env, RasterS_t *rasterP,
int component,
unsigned char *outDataP)
{
....
/* Convert the all bands */
if (rasterP->numBands < 4) {
/* Need to put in alpha */
for (y=0; y < rasterP->height; y++) {
inP = lineInP;
for (x=0; x < rasterP->width; x++) {
for (c=0; c < rasterP->numBands; c++) {
*outP++ = (unsigned char)
(((*inP&rasterP->sppsm.maskArray[c]) >> roff[c])
<<loff[c]);
}
inP++;
}
lineInP += rasterP->scanlineStride;
}
}
else {
for (y=0; y < rasterP->height; y++) {
inP = lineInP;
for (x=0; x < rasterP->width; x++) {
for (c=0; c < rasterP->numBands; c++) {
*outP++ = (unsigned char)
(((*inP&rasterP->sppsm.maskArray[c]) >> roff[c])
<<loff[c]);
}
inP++;
}
lineInP += rasterP->scanlineStride;
}
}
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. d3dshadows.cpp 1410
void CD3D9Renderer::ConfigShadowTexgen(....)
{
....
if ( (pFr->m_Flags & DLF_DIRECTIONAL) ||
(!(pFr->bUseHWShadowMap) && !(pFr->bHWPCFCompare)))
{
//linearized shadows are used for any kind of directional
//lights and for non-hw point lights
m_cEF.m_TempVecs[2][Num] = 1.f / (pFr->fFarDist);
}
else
{
//hw point lights sources have non-linear depth for now
m_cEF.m_TempVecs[2][Num] = 1.f / (pFr->fFarDist);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. ShapeRaster.cpp 1825
void Shape::AvanceEdge(....)
{
....
if ( swrData[no].sens ) {
if ( swrData[no].curX < swrData[no].lastX ) {
line->AddBord(swrData[no].curX,
swrData[no].lastX,
false);
} else if ( swrData[no].curX > swrData[no].lastX ) {
line->AddBord(swrData[no].lastX,
swrData[no].curX,
false);
}
} else {
if ( swrData[no].curX < swrData[no].lastX ) {
line->AddBord(swrData[no].curX,
swrData[no].lastX,
false);
} else if ( swrData[no].curX > swrData[no].lastX ) {
line->AddBord(swrData[no].lastX,
swrData[no].curX,
false);
}
}
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. tree-ssa-threadupdate.c 2596
bool
thread_through_all_blocks (bool may_peel_loop_headers)
{
....
/* Case 1, threading from outside to inside the loop
after we'd already threaded through the header. */
if ((*path)[0]->e->dest->loop_father
!= path->last ()->e->src->loop_father)
{
delete_jump_thread_path (path);
e->aux = NULL;
ei_next (&ei);
}
else
{
delete_jump_thread_path (path);
e->aux = NULL;
ei_next (&ei);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. contactlistitemdelegate.cpp 148
QSize ContactListItemDelegate::sizeHint(....) const
{
....
if (!membersModel)
{
....
}
else
{
if (membersModel->is_short_view_)
return QSize(width, ContactList::ContactItemHeight());
else
return QSize(width, ContactList::ContactItemHeight());
}
return QSize(width, ContactList::ContactItemHeight());
}
V523 The 'then' statement is equivalent to the 'else' statement. stdafx.cpp 42
bool ResourcePrefetcher::ShouldContinueReadingRequest(
net::URLRequest* request,
int bytes_read
)
{
if (bytes_read == 0) { // When bytes_read == 0, no more data.
if (request->was_cached())
FinishRequest(request); // <=
else
FinishRequest(request); // <=
return false;
}
return true;
}
V523 The 'then' statement is equivalent to the 'else' statement. OFaceSet.cpp 230
void OFaceSetSchema::set( const Sample &iSamp )
{
....
if ( iSamp.getSelfBounds().hasVolume() )
{
//Caller explicity set bounds for this sample of the faceset.
m_selfBoundsProperty.set( iSamp.getSelfBounds() ); // <=
}
else
{
m_selfBoundsProperty.set( iSamp.getSelfBounds() ); // <=
//NYI compute self bounds via parent mesh's faces
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. SpellAuras.cpp 1537
void Aura::HandleAuraModShapeshift(bool apply, bool Real)
{
switch (form)
{
case FORM_CAT:
....
case FORM_TRAVEL:
....
case FORM_AQUA:
if (Player::TeamForRace(target->getRace()) == ALLIANCE)
modelid = 2428;
else
modelid = 2428;
....
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. Queque.cpp 358
void FTP::AddToQueque(FAR_FIND_DATA* FileName,
LPCSTR Path,
BOOL Download)
{
....
char *m;
....
if(Download)
m = strrchr(FileName->cFileName, '/');
else
m = strrchr(FileName->cFileName, '/');
....
}
V523 The 'then' statement is equivalent to the 'else' statement. bxe.c 3812
static uint32_t
bxe_send_unload_req(struct bxe_softc *sc,
int unload_mode)
{
uint32_t reset_code = 0;
/* Select the UNLOAD request mode */
if (unload_mode == UNLOAD_NORMAL) {
reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
} else {
reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. linux_ipc.c 353
static int
linux_msqid_pushdown(l_int ver,
struct l_msqid64_ds *linux_msqid64, caddr_t uaddr)
{
....
if (linux_msqid64->msg_qnum > USHRT_MAX)
linux_msqid.msg_qnum = linux_msqid64->msg_qnum;
else
linux_msqid.msg_qnum = linux_msqid64->msg_qnum;
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. ScriptTable.cpp 789
bool CScriptTable::AddFunction(const SUserFunctionDesc& fd)
{
....
char sFuncSignature[256];
if (fd.sGlobalName[0] != 0)
cry_sprintf(sFuncSignature, "%s.%s(%s)", fd.sGlobalName,
fd.sFunctionName, fd.sFunctionParams);
else
cry_sprintf(sFuncSignature, "%s.%s(%s)", fd.sGlobalName,
fd.sFunctionName, fd.sFunctionParams);
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. data3d.cpp 51
void Data3D::getDataProperty(int property, void **_pvData)
{
if (property == UNKNOWN_DATA_PROPERTY)
{
*_pvData = NULL;
}
else
{
*_pvData = NULL;
}
}
V523 The 'then' statement is equivalent to the 'else' statement. ecore_evas_wayland_shm.c 552
void
_ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location)
{
....
if (ECORE_EVAS_PORTRAIT(ee))
ecore_wl_window_resize(wdata->win, ee->w, ee->h, location);
else
ecore_wl_window_resize(wdata->win, ee->w, ee->h, location);
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. ise-stt-option.cpp 433
static Evas_Object *create_language_list(Evas_Object *parent)
{
....
char *s = (char *)disp_lang_array[i];
if (strchr(s, '(')){
item = item_append(genlist, itc_1text, i,
language_set_genlist_radio_cb, genlist);
} else {
item = item_append(genlist, itc_1text, i,
language_set_genlist_radio_cb, genlist);
}
....
}
V523 The 'then' statement is equivalent to the subsequent code fragment. dpm-toolkit-cli.c 87
static int open_entry_popup(const char* title, const char* msg,
const char* guide, char** value)
{
text_header(title, msg);
section_separator();
fancy_text(DEFAULT, NONE, "Enter text(type '.' to cancel) : ");
*value = malloc(64);
scanf("%64s", *value);
if (*value[0] == '.') {
return XTK_EVENT_CANCEL;
}
if (*value[0] == '~') {
return XTK_EVENT_OK; // <=
}
return XTK_EVENT_OK; // <=
}
V523 The 'then' statement is equivalent to the subsequent code fragment. mouse.c 143
static Eina_Bool _move_cb(void *data, int type, void *event)
{
Ecore_Event_Mouse_Move *move = event;
mouse_info.move_x = move->root.x;
mouse_info.move_y = move->root.y;
if (mouse_info.pressed == false) {
return ECORE_CALLBACK_RENEW; // <=
}
return ECORE_CALLBACK_RENEW; // <=
}
V523 The 'then' statement is equivalent to the 'else' statement. page_setting_all.c 125
static void _content_resize(...., const char *signal)
{
....
if (strcmp(signal, "portrait") == 0) {
evas_object_size_hint_min_set(s_info.layout,
ELM_SCALE_SIZE(width), ELM_SCALE_SIZE(height));
} else {
evas_object_size_hint_min_set(s_info.layout,
ELM_SCALE_SIZE(width), ELM_SCALE_SIZE(height));
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. bt-httpproxy.c 383
static void _bt_hps_set_notify_read_status(const char *obj_path,
guint offset_status, guint read_status, int https_status)
{
....
if (!hps_notify_read_list) {
/* Store Notification information */
notify_read_info = g_new0(struct hps_notify_read_info, 1);
if (notify_read_info) {
notify_read_info->char_path = g_strdup(obj_path);
notify_read_info->read_status = read_status;
notify_read_info->offset_status = offset_status;
notify_read_info->https_status = https_status;
hps_notify_read_list = g_slist_append(hps_notify_read_list,
notify_read_info);
}
return;
} else {
/* Store Notification information */
notify_read_info = g_new0(struct hps_notify_read_info, 1);
if (notify_read_info) {
notify_read_info->char_path = g_strdup(obj_path);
notify_read_info->read_status = read_status;
notify_read_info->offset_status = offset_status;
notify_read_info->https_status = https_status;
hps_notify_read_list = g_slist_append(hps_notify_read_list,
notify_read_info);
}
return;
}
}
V523 The 'then' statement is equivalent to the 'else' statement. pluginCreator.cpp 84
PluginCreator::PluginCreator(QWidget* parent)
: QMainWindow(parent)
{
....
if (qApp->layoutDirection() == Qt::LayoutDirection::....) {
editTools->addAction(actionUndo);
editTools->addAction(actionRedo);
}
else {
editTools->addAction(actionUndo);
editTools->addAction(actionRedo);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. AButton.cpp 297
AButton::AButtonState AButton::GetState()
{
....
if (mIsClicking) {
state = mButtonIsDown ? AButtonOver : AButtonDown; //ok
}
else {
state = mButtonIsDown ? AButtonDown : AButtonOver; //ok
}
}
}
else {
if (mToggle) {
state = mButtonIsDown ? AButtonDown : AButtonUp; // <= fail
}
else {
state = mButtonIsDown ? AButtonDown : AButtonUp; // <= fail
}
}
return state;
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. HydrogenXMLHandler.cpp 476
bool
HydrogenXMLHandler::characters(const QString& chars)
{
bool rc=false;
if (m_version=="") {
/* no version yet, use 093 */
rc=characters_093(chars);
}
else {
/* select version dependant function */
rc=characters_093(chars);
}
return rc;
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. mdaJX10Processor.cpp 522
void JX10Processor::noteOn (....)
{
....
if (!polyMode) //monophonic retriggering
{
voice[v].env += SILENCE + SILENCE;
}
else
{
//if (params[15] < 0.28f)
//{
// voice[v].f0 = voice[v].f1 = voice[v].f2 = 0.0f;
// voice[v].env = SILENCE + SILENCE;
// voice[v].fenv = 0.0f;
//}
//else
voice[v].env += SILENCE + SILENCE; //anti-glitching trick
}
....
}
V523 CWE-691 The 'then' statement is equivalent to the 'else' statement. cpwl_edit_impl.cpp 1580
bool CPWL_EditImpl::Backspace(bool bAddUndo, bool bPaint) {
....
if (m_wpCaret.nSecIndex != m_wpOldCaret.nSecIndex) {
AddEditUndoItem(pdfium::MakeUnique<CFXEU_Backspace>(
this, m_wpOldCaret, m_wpCaret, word.Word, word.nCharset));
} else {
AddEditUndoItem(pdfium::MakeUnique<CFXEU_Backspace>(
this, m_wpOldCaret, m_wpCaret, word.Word, word.nCharset));
}
....
}
Regardless of a condition, one and the same action is executed. Most likely, there's some sort of a typo.
Similar errors can be found in some other places:
V523 CWE-691 The 'then' statement is equivalent to the 'else' statement. gd32f4xx_can.c 254
void can_debug_freeze_disable(uint32_t can_periph)
{
CAN_CTL(can_periph) &= ~CAN_CTL_DFZ;
if(CAN0 == can_periph){
dbg_periph_disable(DBG_CAN0_HOLD);
}else{
dbg_periph_disable(DBG_CAN0_HOLD);
}
}
V523 The 'then' statement is equivalent to the 'else' statement. kis_processing_applicator.cpp 227
void KisProcessingApplicator::applyVisitorAllFrames(....)
{
KisLayerUtils::FrameJobs jobs;
if (m_flags.testFlag(RECURSIVE)) {
KisLayerUtils::updateFrameJobsRecursive(&jobs, m_node);
} else {
KisLayerUtils::updateFrameJobsRecursive(&jobs, m_node);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. toglsloperand.c 700
void TranslateVariableNameByOperandType(....)
{
// Igor: yet another Qualcomm's special case
// GLSL compiler thinks that -2147483648 is
// an integer overflow which is not
if (*((int*)(&psOperand->afImmediates[0])) == 2147483648)
{
bformata(glsl, "-2147483647-1");
}
else
{
// Igor: this is expected to fix
// paranoid compiler checks such as Qualcomm's
if (*((unsigned int*)(&psOperand->afImmediates[0])) >= 2147483648)
{
bformata(glsl, "%d",
*((int*)(&psOperand->afImmediates[0])));
}
else
{
bformata(glsl, "%d",
*((int*)(&psOperand->afImmediates[0])));
}
}
bcatcstr(glsl, ")");
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. toke.c 12056
static U8 *
S_add_utf16_textfilter(pTHX_ U8 *const s, bool reversed)
{
....
SvCUR_set(PL_linestr, 0);
if (FILTER_READ(0, PL_linestr, 0)) {
SvUTF8_on(PL_linestr);
} else {
SvUTF8_on(PL_linestr);
}
PL_bufend = SvEND(PL_linestr);
return (U8*)SvPVX(PL_linestr);
}
V523 CWE-691 The 'then' statement is equivalent to the 'else' statement. qgraphicsscene_bsp.cpp 179
QString QGraphicsSceneBspTree::debug(int index) const
{
....
if (node->type == Node::Horizontal) {
tmp += debug(firstChildIndex(index));
tmp += debug(firstChildIndex(index) + 1);
} else {
tmp += debug(firstChildIndex(index));
tmp += debug(firstChildIndex(index) + 1);
}
....
}
V523 The 'then' statement is equivalent to the subsequent code fragment. vcf_reader.cpp 1105
bool
CVcfReader::xAssignFeatureLocationSet(....)
{
....
if (data.m_SetType == CVcfData::ST_ALL_DEL) {
if (data.m_strRef.size() == 1) {
//deletion of a single base
pFeat->SetLocation().SetPnt().SetPoint(data.m_iPos-1);
pFeat->SetLocation().SetPnt().SetId(*pId);
}
else {
pFeat->SetLocation().SetInt().SetFrom(data.m_iPos-1);
//-1 for 0-based,
//another -1 for inclusive end-point ( i.e. [], not [) )
pFeat->SetLocation().SetInt().SetTo(
data.m_iPos -1 + data.m_strRef.length() - 1);
pFeat->SetLocation().SetInt().SetId(*pId);
}
return true;
}
//default: For MNV's we will use the single starting point
//NB: For references of size >=2, this location will not
//match the reference allele. Future Variation-ref
//normalization code will address these issues,
//and obviate the need for this code altogether.
if (data.m_strRef.size() == 1) {
//deletion of a single base
pFeat->SetLocation().SetPnt().SetPoint(data.m_iPos-1);
pFeat->SetLocation().SetPnt().SetId(*pId);
}
else {
pFeat->SetLocation().SetInt().SetFrom(data.m_iPos-1);
pFeat->SetLocation().SetInt().SetTo(
data.m_iPos -1 + data.m_strRef.length() - 1);
pFeat->SetLocation().SetInt().SetId(*pId);
}
return true;
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. svdpdf.hxx 146
/// Transform the rectangle (left, right, top, bottom) by this Matrix.
template <typename T> void Transform(....)
{
....
if (top > bottom)
top = std::max(leftTopY, rightTopY);
else
top = std::min(leftTopY, rightTopY);
if (top > bottom)
bottom = std::max(leftBottomY, rightBottomY); // <=
else
bottom = std::max(leftBottomY, rightBottomY); // <=
}
V523 The 'then' statement is equivalent to the 'else' statement. docxattributeoutput.cxx 1571
void DocxAttributeOutput::DoWritePermissionTagEnd(
const OUString & permission)
{
OUString permissionIdAndName;
if (permission.startsWith("permission-for-group:", &permissionIdAndName))
{
const sal_Int32 sparatorIndex = permissionIdAndName.indexOf(':');
const OUString permissionId = permissionIdAndName.copy(....);
const OString rId = OUStringToOString(....).getStr();
m_pSerializer->singleElementNS(XML_w, XML_permEnd,
FSNS(XML_w, XML_id), rId.getStr(),
FSEND);
}
else
{
const sal_Int32 sparatorIndex = permissionIdAndName.indexOf(':');
const OUString permissionId = permissionIdAndName.copy(....);
const OString rId = OUStringToOString(....).getStr();
m_pSerializer->singleElementNS(XML_w, XML_permEnd,
FSNS(XML_w, XML_id), rId.getStr(),
FSEND);
}
}
V523 The 'then' statement is equivalent to the 'else' statement. Number.cc 4018
bool Number::square()
{
....
if(mpfr_cmpabs(i_value->internalLowerFloat(),
i_value->internalUpperFloat()) > 0) {
mpfr_sqr(f_tmp, i_value->internalLowerFloat(), MPFR_RNDU);
mpfr_sub(f_rl, f_rl, f_tmp, MPFR_RNDD);
} else {
mpfr_sqr(f_tmp, i_value->internalLowerFloat(), MPFR_RNDU);
mpfr_sub(f_rl, f_rl, f_tmp, MPFR_RNDD);
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. subr_gtaskqueue.c 191
#define TQ_LOCK(tq) \
do { \
if ((tq)->tq_spin) \
mtx_lock_spin(&(tq)->tq_mutex); \
else \
mtx_lock(&(tq)->tq_mutex); \
} while (0)
#define TQ_ASSERT_LOCKED(tq) mtx_assert(&(tq)->tq_mutex, MA_OWNED)
#define TQ_UNLOCK(tq) \
do { \
if ((tq)->tq_spin) \
mtx_unlock_spin(&(tq)->tq_mutex); \
else \
mtx_unlock(&(tq)->tq_mutex); \
} while (0)
void
grouptask_block(struct grouptask *grouptask)
{
....
TQ_LOCK(queue);
gtask->ta_flags |= TASK_NOENQUEUE;
gtaskqueue_drain_locked(queue, gtask);
TQ_UNLOCK(queue);
}
void
grouptask_block(struct grouptask *grouptask)
{
....
do { if ((queue)->tq_spin) mtx_lock(&(queue)->tq_mutex);
else mtx_lock(&(queue)->tq_mutex); } while (0);
gtask->ta_flags |= 0x4;
gtaskqueue_drain_locked(queue, gtask);
do { if ((queue)->tq_spin) mtx_unlock(&(queue)->tq_mutex);
else mtx_unlock(&(queue)->tq_mutex); } while (0);
}
mutex.h
/* on FreeBSD these are different functions */
#define mtx_lock_spin(x) mtx_lock(x)
#define mtx_unlock_spin(x) mtx_unlock(x)
V523 The 'then' statement is equivalent to the subsequent code fragment. archive_read_support_format_ar.c 415
static int
_ar_read_header(struct archive_read *a, struct archive_entry *entry,
struct ar *ar, const char *h, size_t *unconsumed)
{
....
/*
* "__.SYMDEF" is a BSD archive symbol table.
*/
if (strcmp(filename, "__.SYMDEF") == 0) {
archive_entry_copy_pathname(entry, filename);
/* Parse the time, owner, mode, size fields. */
return (ar_parse_common_header(ar, entry, h));
}
/*
* Otherwise, this is a standard entry. The filename
* has already been trimmed as much as possible, based
* on our current knowledge of the format.
*/
archive_entry_copy_pathname(entry, filename);
return (ar_parse_common_header(ar, entry, h));
}
V523 The 'then' statement is equivalent to the 'else' statement. TKDTree.cxx 805
template <typename Index, typename Value>
void TKDTree<Index, Value>::UpdateRange(....)
{
....
if (point[fAxis[inode]]<=fValue[inode]){
//first examine the node that contains the point
UpdateRange(GetLeft(inode),point, range, res);
UpdateRange(GetRight(inode),point, range, res);
} else {
UpdateRange(GetLeft(inode),point, range, res);
UpdateRange(GetRight(inode),point, range, res);
}
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. RADAR.CPP 1827
void RadarClass::Player_Names(bool on)
{
IsPlayerNames = on;
IsToRedraw = true;
if (on) {
Flag_To_Redraw(true);
// Flag_To_Redraw(false);
} else {
Flag_To_Redraw(true); // force drawing of the plate
}
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. cp0_helper.c 383
target_ulong helper_mftc0_cause(CPUMIPSState *env)
{
....
CPUMIPSState *other = mips_cpu_map_tc(env, &other_tc);
if (other_tc == other->current_tc) {
tccause = other->CP0_Cause;
} else {
tccause = other->CP0_Cause;
}
....
}
V523 The 'then' statement is equivalent to the 'else' statement. pprint.hpp 715
template <typename Container>
typename std::enable_if<......>::type print_internal(......) {
....
for (size_t i = 1; i < value.size() - 1; i++) {
print_internal(value[i], indent + indent_, "", level + 1);
if (is_container<T>::value == false)
print_internal_without_quotes(", ", 0, "\n");
else
print_internal_without_quotes(", ", 0, "\n");
}
....
}
Similar errors can be found in some other places:
V523 The 'then' statement is equivalent to the 'else' statement. timer.c 292
esp_err_t timer_isr_register(....)
{
....
if ((intr_alloc_flags & ESP_INTR_FLAG_EDGE) == 0) {
intr_source = ETS_TG1_T0_LEVEL_INTR_SOURCE + timer_num;
} else {
intr_source = ETS_TG1_T0_LEVEL_INTR_SOURCE + timer_num;
}
....
}