Skip to content

Small fix #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion RMModelObject.mm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ inline InSituCString()

inline InSituCString(const char* aCString)
: cString(aCString)
, length(strlen(aCString))
, length((unsigned)strlen(aCString))
{
}

Expand Down Expand Up @@ -462,6 +462,9 @@ int RMTypeEncodingCompare(const char* lhs, const char* rhs)
return strippedLHS.compare(strippedRHS);
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"

+ (Method)_assignmentAccessorForTypeEncoding:(const char* const)typeEncoding wantsSetterMethod:(BOOL)wantsSetterMethod
{
switch(wantsSetterMethod)
Expand Down Expand Up @@ -553,6 +556,8 @@ + (Method)_assignmentAccessorForTypeEncoding:(const char* const)typeEncoding wan
return NULL;
}

#pragma clang diagnostic pop

#define DEFINE_PRIMITIVE_GETTER_METHOD(typeName, uppercasedTypeName) \
- (typeName)_modelObjectGet ## uppercasedTypeName \
{ \
Expand Down Expand Up @@ -781,11 +786,16 @@ Class RMModelObjectInitializeDynamicClass(Class self)
RMClassAddMethod(dynamicClass, sel_registerName(getterName), method_getImplementation(getter), method_getTypeEncoding(getter));
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"

Method setter = NULL;
if(propertyAttributes.assignmentMode == ObjCPropertyAssignmentModeAssign) setter = (Method)[self _assignmentAccessorForTypeEncoding:propertyTypeEncoding wantsSetterMethod:YES];
else if(propertyAttributes.assignmentMode == ObjCPropertyAssignmentModeRetain) setter = GetSetterMethod(self, @selector(_modelObjectSetIdRetain:));
else if(propertyAttributes.assignmentMode == ObjCPropertyAssignmentModeCopy) setter = GetSetterMethod(self, @selector(_modelObjectSetIdCopy:));

#pragma clang diagnostic pop

RMClassAddMethod(dynamicClass, sel_registerName(setterName), method_getImplementation(setter), method_getTypeEncoding(setter));

class_addProtocol(dynamicClass, @protocol(NSCoding));
Expand Down