* shutup all clang warnings of type:

equality comparison with extraneous parentheses
          all harmless, but in EOEntity.m it actually was wrong



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@36231 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Sebastian Reitenbach 2013-03-02 13:59:48 +00:00
parent b2b2b838f3
commit de5c0311d1
13 changed files with 51 additions and 35 deletions

View file

@ -530,11 +530,11 @@ NSString *EOMConsistencyModelObjectKey = @"EOMConsistencyModelObjectKey";
return 2;
}
if ((item == entitiesItem)) {
if (item == entitiesItem) {
return [[_eomodel entityNames] count];
}
if ((item == storedProceduresItem)) {
if (item == storedProceduresItem) {
return [[_eomodel storedProcedureNames] count];
}
@ -556,19 +556,19 @@ NSString *EOMConsistencyModelObjectKey = @"EOMConsistencyModelObjectKey";
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item
{
if (!item) {
if ((index == 0)) {
if (index == 0) {
return entitiesItem;
}
if ((index == 1)) {
if (index == 1) {
return storedProceduresItem;
}
}
if ((item == entitiesItem)) {
if (item == entitiesItem) {
return [[_eomodel entityNames] objectAtIndex:index];
}
if ((item == storedProceduresItem)) {
if (item == storedProceduresItem) {
return [[_eomodel storedProcedureNames] objectAtIndex:index];
}
@ -584,11 +584,11 @@ NSString *EOMConsistencyModelObjectKey = @"EOMConsistencyModelObjectKey";
// return @"EOModel";
return nil;
}
if ((item == entitiesItem)) {
if (item == entitiesItem) {
return entitiesItem;
}
if ((item == storedProceduresItem)) {
if (item == storedProceduresItem) {
return storedProceduresItem;
}
//
@ -1011,21 +1011,21 @@ NSString *EOMConsistencyModelObjectKey = @"EOMConsistencyModelObjectKey";
//NSLog(@"%s: %@", __PRETTY_FUNCTION__, anItem);
if ((action == @selector(addAttribute:))) {
if (action == @selector(addAttribute:)) {
if ((!_outlineSelection) ||
(([_outlineSelection class] != [EOEntity class]) && ([_outlineSelection class] != [EOStoredProcedure class]))) {
return NO;
}
}
if ((action == @selector(addRelationship:))) {
if (action == @selector(addRelationship:)) {
if ((!_outlineSelection) ||
([_outlineSelection class] != [EOEntity class])) {
return NO;
}
}
if ((action == @selector(delete:))) {
if (action == @selector(delete:)) {
if ((!_outlineSelection) || (!_selectedObjects)) {
return NO;
}

View file

@ -63,7 +63,7 @@
return nil;
// NSInteger row = [destinationEntityBrowser selectedRow];
if ((row == -1))
if (row == -1)
return nil;
return [[[[NSApp activeDocument] eomodel] entities] objectAtIndex:row];

View file

@ -152,7 +152,7 @@
id obj = [notif object];
if (_selectedDict) {
if ((obj == _textView)) {
if (obj == _textView) {
// I dont know why that stringWithString is needed here,
// but it seems to fix an OSX bug that messes up values -- dw
[_selectedDict setObject:[NSString stringWithString:[_textView string]]

View file

@ -63,7 +63,7 @@
return nil;
// NSInteger row = [destinationEntityBrowser selectedRow];
if ((row == -1))
if (row == -1)
return nil;
return [[[[NSApp activeDocument] eomodel] entities] objectAtIndex:row];

View file

@ -222,19 +222,19 @@
NSInteger intVal = 0;
EOModel *activeModel = nil;
if ((sender == destinationEntityBrowser)) {
if (sender == destinationEntityBrowser) {
activeModel = [[NSApp activeDocument] eomodel];
return [[activeModel entityNames] count];
}
if ((sender == sourceBrowser)) {
if (sender == sourceBrowser) {
EOEntity * selectedEntity = [_currentRelation entity];
NSArray * attributes = [selectedEntity attributes];
return [attributes count];
}
if ((sender == destBrowser)) {
if (sender == destBrowser) {
EOEntity * destinationEntity = [_currentRelation destinationEntity];
NSArray * dstAttributes = nil;
@ -265,7 +265,7 @@
EOEntity * selectedEntity = nil;
EOEntity * destinationEntity = nil;
if ((sender == destinationEntityBrowser)) {
if (sender == destinationEntityBrowser) {
activeModel = [[NSApp activeDocument] eomodel];
[cell setLeaf:YES];
@ -278,7 +278,7 @@
selectedEntity = [_currentRelation entity];
if (((sender == sourceBrowser)) && (selectedEntity)) {
if ((sender == sourceBrowser) && (selectedEntity)) {
NSArray * attributes = [selectedEntity attributes];
NSString * name = [[attributes objectAtIndex:row] name];
NSUInteger idx;

View file

@ -1,3 +1,19 @@
2013-03-02: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
* Apps/EOModelEditor/EOMEDocument.m
* Apps/EOModelEditor/Inspectors/AdvancedRelationshipInspector.m
* Apps/EOModelEditor/Inspectors/ConnectionDictionaryInspector.m
* Apps/EOModelEditor/Inspectors/EntityInspector.m
* Apps/EOModelEditor/Inspectors/RelationshipInspector.m
* EOAccess/EOAdaptor.m
* EOAccess/EODatabaseContext.m
* EOAccess/EOEntity.m
* EOAccess/EOModel.m
* EOAccess/EOStoredProcedure.m
* EOControl/EOMutableKnownKeyDictionary.m
* EOControl/EOObserver.m
* shutup all clang warnings of type:
equality comparison with extraneous parentheses
all harmless, but in EOEntity.m it actually was wrong
2013-03-01: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
* EOControl/EODebug.m
do not use redundant stringWithString

View file

@ -600,7 +600,7 @@ NSString *EOAdministrativeConnectionDictionaryKey
// but better there than in GSWeb and GDL -- dw
stringEncoding = [GSMimeDocument encodingFromCharset:encodingValue];
if ((stringEncoding == 0)) {
if (stringEncoding == 0) {
return [NSString defaultCStringEncoding];
}
}

View file

@ -2284,14 +2284,14 @@ forDatabaseOperation:(EODatabaseOperation *)op
updatedSnapValue = [updatedEOSnap objectForKey:[substRelationship name]];
if ((updatedSnapValue == GDL2_EONull))
if (updatedSnapValue == GDL2_EONull)
{
updatedSnapValue = nil;
}
currentSnapValue = [currentCSnapDict objectForKey:[substRelationship name]];
if ((currentSnapValue == GDL2_EONull))
if (currentSnapValue == GDL2_EONull)
{
currentSnapValue = nil;
}
@ -2413,14 +2413,14 @@ forDatabaseOperation:(EODatabaseOperation *)op
updatedSnapValue = [updateSnapDict objectForKey:[substitutionRel name]];
if ((updatedSnapValue == GDL2_EONull))
if (updatedSnapValue == GDL2_EONull)
{
updatedSnapValue = nil;
}
currentSnapValue = [comSnapUpdatedEO objectForKey:[substitutionRel name]];
if ((currentSnapValue == GDL2_EONull))
if (currentSnapValue == GDL2_EONull)
{
currentSnapValue = nil;
}
@ -2431,8 +2431,8 @@ forDatabaseOperation:(EODatabaseOperation *)op
NSArray * currentSnapValues = (NSArray*) currentSnapValue;
NSMutableArray * snaps = nil;
if (((updatedSnapValues == currentSnapValues)) ||
([currentSnapValues isEqualToArray:updatedSnapValues]))
if ((updatedSnapValues == currentSnapValues) ||
[currentSnapValues isEqualToArray:updatedSnapValues])
{
continue;
}
@ -2875,7 +2875,7 @@ Raises an exception is the adaptor is unable to perform the operations.
{
[object takeStoredValuesFromDictionary:newRowValues];
}
if ((databaseOperator == EODatabaseInsertOperator))
if (databaseOperator == EODatabaseInsertOperator)
{
[_database incrementSnapshotCountForGlobalID:dbOpeGID];
}
@ -6133,7 +6133,7 @@ compareUsingEntityNames(id left, id right, void* vpSortOrders)
}
// no PK? Ask the delegate to make one for us.
if ((pk == nil))
if (pk == nil)
{
if (_delegateRespondsTo.newPrimaryKey == YES)
pk = [_delegate databaseContext: self
@ -6142,7 +6142,7 @@ compareUsingEntityNames(id left, id right, void* vpSortOrders)
}
// still no PK?
if ((pk == nil))
if (pk == nil)
{
EOAdaptorChannel *channel = nil;
EOStoredProcedure *nextPKProcedure = nil;

View file

@ -257,7 +257,7 @@ NSString *EONextPrimaryKeyProcedureOperation = @"EONextPrimaryKeyProcedureOperat
_flags.relationshipsIsLazy = YES;
}
if ((aDict == [propertyList objectForKey: @"storedProcedureNames"]))
if ((aDict = [propertyList objectForKey: @"storedProcedureNames"]) != nil)
{
NSEnumerator * keyEnumerator = [aDict keyEnumerator];
NSString * curentKey;

View file

@ -1368,7 +1368,7 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
NSUInteger index = 0;
NSUInteger count = 0;
if ((i == 0))
if (i == 0)
{
attrsOrRels = [entity attributes];
} else {

View file

@ -207,7 +207,7 @@ RCS_ID("$Id$")
- (void)setName: (NSString *)name
{
if ((_name == name)) {
if (_name == name) {
return;
}

View file

@ -832,14 +832,14 @@ RCS_ID("$Id$")
index = EOMKKDInitializer_indexForKeyWithImpPtr(_MKKDInitializer,NULL,key);
if ((index == NSNotFound))
if (index == NSNotFound)
{
if (_extraData)
object = [_extraData objectForKey: key];
}
else
{
NSAssert2(index < [_MKKDInitializer count], @"bad index %d (count=%u)",
NSAssert2(index < [_MKKDInitializer count], @"bad index %u (count=%u)",
index, [_MKKDInitializer count]);
object = _values[index];
}

View file

@ -450,7 +450,7 @@ static EODelayedObserverQueue *observerQueue;
*/
- init
{
if ((self == [super init]))
if (self == [super init])
{
ASSIGN(_modes, [NSArray arrayWithObject: NSDefaultRunLoopMode]);
}