Skip to content

Commit

Permalink
SEC macro (and others) overflowed on 32-bit systems
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Jun 25, 2023
1 parent a98c22a commit 6d5f076
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Emulator/Base/Aliases.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ typedef u32 Block;
//

// Converts a certain unit to master cycles
#define USEC(delay) (Cycle)((delay) * 28)
#define MSEC(delay) (Cycle)((delay) * 28000)
#define SEC(delay) (Cycle)((delay) * 28000000)
#define USEC(delay) (Cycle(delay) * 28)
#define MSEC(delay) (Cycle(delay) * 28000)
#define SEC(delay) (Cycle(delay) * 28000000)

#define CPU_CYCLES(cycles) ((Cycle)(cycles) << 2)
#define CIA_CYCLES(cycles) ((Cycle)(cycles) * 40)
#define DMA_CYCLES(cycles) ((Cycle)(cycles) << 3)
#define CPU_CYCLES(cycles) (Cycle(cycles) << 2)
#define CIA_CYCLES(cycles) (Cycle(cycles) * 40)
#define DMA_CYCLES(cycles) (Cycle(cycles) << 3)

// Converts master cycles to a certain unit
#define AS_USEC(delay) ((delay) / 28)
Expand Down
6 changes: 3 additions & 3 deletions GUI/Dialogs/Inspector/MemoryPanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension Inspector {
let ptr = mask.bindMemory(to: UInt32.self, capacity: cap)

// Create image data
for bank in 0..<256 {
for bank in 0...255 {

var color: NSColor
var mirror = false
Expand Down Expand Up @@ -85,12 +85,12 @@ extension Inspector {
r = Int(ciBgColor.red * CGFloat(255 - y*c))
g = Int(ciBgColor.green * CGFloat(255 - y*c))
b = Int(ciBgColor.blue * CGFloat(255 - y*c))
a = Int(ciBgColor.alpha)
a = Int(ciBgColor.alpha * CGFloat(255))
} else {
r = Int(ciColor.red * CGFloat(255 - y*c))
g = Int(ciColor.green * CGFloat(255 - y*c))
b = Int(ciColor.blue * CGFloat(255 - y*c))
a = Int(ciColor.alpha)
a = Int(ciColor.alpha * CGFloat(255))
}
let abgr = UInt32(r | g << 8 | b << 16 | a << 24)
ptr[y*width + dx] = abgr
Expand Down
2 changes: 1 addition & 1 deletion GUI/Metal/ImageToolbox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public extension NSImage {
static func make(data: UnsafeMutableRawPointer, rect: CGSize) -> NSImage? {

guard let cgImage = CGImage.make(data: data, size: rect) else {
warn("Failed to create CGImage.")
warn("Failed to create CGImage")
return nil
}

Expand Down
6 changes: 4 additions & 2 deletions vAmiga.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2549,7 +2549,7 @@
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -2641,7 +2641,7 @@
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -2723,6 +2723,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_UNDEFINED_BEHAVIOR_SANITIZER_INTEGER = YES;
CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES;
CODE_SIGN_ENTITLEMENTS = Resources/vAmiga.entitlements;
Expand Down Expand Up @@ -2767,6 +2768,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_UNDEFINED_BEHAVIOR_SANITIZER_INTEGER = YES;
CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES;
CODE_SIGN_ENTITLEMENTS = Resources/vAmiga.entitlements;
Expand Down

0 comments on commit 6d5f076

Please sign in to comment.