Skip to content
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

Fixes a couple of build warnings #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions desmume/src/cp15.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ BOOL armcp15_t::moveCP2ARM(u32 * R, u8 CRn, u8 CRm, u8 opcode1, u8 opcode2)
}
return FALSE;
case 9:
if((opcode1==0))
if(opcode1==0)
{
switch(CRm)
{
Expand Down Expand Up @@ -556,7 +556,7 @@ BOOL armcp15_t::moveARM2CP(u32 val, u8 CRn, u8 CRm, u8 opcode1, u8 opcode2)
}
return FALSE;
case 9:
if((opcode1==0))
if(opcode1==0)
{
switch(CRm)
{
Expand Down
4 changes: 2 additions & 2 deletions desmume/src/utils/vfat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ bool VFAT::build(const char* path, int extra_MB)

if(dataSectors>=(0x80000000>>9))
{
printf("error allocating memory for fat (%d KBytes)\n",(dataSectors*512)/1024);
printf("error allocating memory for fat (%llu KBytes)\n",(dataSectors*512)/1024);
printf("total fat sizes > 2GB are never going to work\n");
}

Expand All @@ -181,7 +181,7 @@ bool VFAT::build(const char* path, int extra_MB)

if(file == NULL)
{
printf("error allocating memory for fat (%d KBytes)\n",(dataSectors*512)/1024);
printf("error allocating memory for fat (%llu KBytes)\n",(dataSectors*512)/1024);
printf("(out of memory)\n");
return false;
}
Expand Down
16 changes: 8 additions & 8 deletions iNDS/7zMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,17 +774,17 @@ int do7z_extract_entry(char *archivePath, char *archiveCachePath, char *entryNam
return 0;
}
if (res == SZ_ERROR_UNSUPPORTED) {
return 3;
PrintError("decoder doesn't support this archive");
PrintError("decoder doesn't support this archive");
return 3;
} else if (res == SZ_ERROR_MEM) {
return 4;
PrintError("can not allocate memory");
PrintError("can not allocate memory");
return 4;
} else if (res == SZ_ERROR_CRC) {
return 5;
PrintError("CRC error");
PrintError("CRC error");
return 5;
} else {
return 6;
printf("\nERROR #%d\n", res);
printf("\nERROR #%d\n", res);
return 6;
}
return 7;
}
3 changes: 1 addition & 2 deletions iNDS/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ - (void)startBackgroundProcesses
} else {
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
NSData *plistData = [NSData dataWithContentsOfFile:plistPath];
NSDictionary *loadedPlist =
[NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:0 format:NULL errorDescription:NULL];
NSDictionary *loadedPlist = [NSPropertyListSerialization propertyListWithData:plistData options:0 format:NULL error:NULL];
NSString *scheme = [[[[loadedPlist objectForKey:@"CFBundleURLTypes"] objectAtIndex:0] objectForKey:@"CFBundleURLSchemes"] objectAtIndex:0];
if ([scheme isEqual:@"db-APP_KEY"]) {
errorMsg = @"You must set the URL Scheme correctly in iNDS-Info.plist for Dropbox to work!";
Expand Down
228 changes: 114 additions & 114 deletions iNDS/Base.lproj/MainStoryboard.storyboard

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions iNDS/SSZipArchive.m
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ - (BOOL)open {

- (void)zipInfo:(zip_fileinfo*)zipInfo setDate:(NSDate*)date {
NSCalendar *currentCalendar = [NSCalendar currentCalendar];
uint flags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
uint flags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond;
NSDateComponents *components = [currentCalendar components:flags fromDate:date];
zipInfo->tmz_date.tm_sec = (unsigned int)components.second;
zipInfo->tmz_date.tm_min = (unsigned int)components.minute;
Expand Down Expand Up @@ -396,7 +396,7 @@ + (NSDate *)_dateWithMSDOSFormat:(UInt32)msdosDateTime {
static const UInt32 kMinuteMask = 0x7E0;
static const UInt32 kSecondMask = 0x1F;

NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
NSDateComponents *components = [[NSDateComponents alloc] init];

NSAssert(0xFFFFFFFF == (kYearMask | kMonthMask | kDayMask | kHourMask | kMinuteMask | kSecondMask), @"[SSZipArchive] MSDOS date masks don't add up");
Expand Down
2 changes: 1 addition & 1 deletion iNDS/WCBuildStoreClient/WCBuildStoreClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ - (void)checkForUpdates
if (CSRF) {
NSString *post = @"appId=90"; //Needs to ba changed per app
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%ld", [postData length]];
NSString *postLength = [NSString stringWithFormat:@"%ld", (unsigned long)[postData length]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:@"http://builds.io/api/resign/"]];
[request setHTTPMethod:@"POST"];
Expand Down
2 changes: 1 addition & 1 deletion iNDS/ZAActivityBar/SKBounceAnimation/SKBounceAnimation.m
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ - (NSArray*) valueArrayForStartValue:(CGFloat)startValue endValue:(CGFloat)endVa
NSMutableArray *values = [NSMutableArray arrayWithCapacity:steps];
CGFloat value = 0;

CGFloat sign = (endValue-startValue)/fabsf(endValue-startValue);
CGFloat sign = (endValue-startValue)/fabs(endValue-startValue);

CGFloat oscillationComponent;
CGFloat coefficient;
Expand Down
10 changes: 5 additions & 5 deletions iNDS/ZAActivityBar/ZAActivityBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ - (void) updateActionIndicator {
}

- (void) setActionIndicatorCount:(NSUInteger)count {
[self.actionIndicatorLabel setText:[NSString stringWithFormat:@"%lu", count]];
[self.actionIndicatorLabel setText:[NSString stringWithFormat:@"%lu", (unsigned long)count]];
// May want to resize the shape to make a 'pill' shape in the future? Still looks fine for
// numbers up to 100.
}
Expand Down Expand Up @@ -377,8 +377,8 @@ - (void)setStatus:(NSString *)string {
if(string) {
float offset = (SPINNER_SIZE + 2 * ICON_OFFSET);
float width = self.barView.frame.size.width - offset;
CGSize stringSize = [string sizeWithFont:self.stringLabel.font
constrainedToSize:CGSizeMake(width, 300)];
CGSize stringSize = [string boundingRectWithSize:CGSizeMake(width, 300) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: self.stringLabel.font} context:NULL].size;//[string sizeWithFont:self.stringLabel.font
// constrainedToSize:CGSizeMake(width, 300)];
stringWidth = stringSize.width;
stringHeight = stringSize.height;

Expand Down Expand Up @@ -410,7 +410,7 @@ + (void) dismissForAction:(NSString *)action {

- (void) dismissAll {

for (int i = (_actionArray.count - 1); i >= 0; i--) {
for (int i = (int)(_actionArray.count - 1); i >= 0; i--) {
NSString *action = [_actionArray objectAtIndex:i];

// First item (visible one)
Expand Down Expand Up @@ -560,7 +560,7 @@ - (void) removeAnimationForKey:(NSString *)key {
int frame = (diff * 58.57 - 1); // 58fps?
NSArray *frames = [anim valueForKey:@"values"];
if (frame >= frames.count) // For security
frame = frames.count - 1;
frame = (int)(frames.count - 1);

float yOffset = [[frames objectAtIndex:frame] floatValue];

Expand Down
2 changes: 1 addition & 1 deletion iNDS/core/throttle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void SpeedThrottle()
else
sleepy = 0;
if(sleepy >= 10)
Sleep((sleepy / 2)); // reduce it further beacuse Sleep usually sleeps for more than the amount we tell it to
Sleep((int)(sleepy / 2)); // reduce it further beacuse Sleep usually sleeps for more than the amount we tell it to
#ifndef ANDROID
else if(sleepy > 0) // spin for <1 millisecond waits
SwitchToThread(); // limit to other threads on the same CPU core for other short waits
Expand Down