From 7c328edd4ab7560e956e56b6958e2f297e4e0cec Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 21 Oct 2022 15:28:11 -0400 Subject: [PATCH 1/2] Use built-in install build trigger. --- OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj index 25161def6..61bc0a002 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj +++ b/OSBindings/Mac/Clock Signal.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -5489,7 +5489,8 @@ /* Begin PBXShellScriptBuildPhase section */ 4B2D26A8288EDAFB00F27D66 /* Set Archive Version Number */ = { isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; + alwaysOutOfDate = 1; + buildActionMask = 8; files = ( ); inputFileListPaths = ( @@ -5501,9 +5502,9 @@ ); outputPaths = ( ); - runOnlyForDeploymentPostprocessing = 0; + runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; - shellScript = "#!/bin/bash\nset\n\n# Change fields only for archive builds; this helps to avoid source control pollution.\nif [ $ACTION != \"install\" ]; then\n exit 0\nfi\n\n# Set both version numbers to yy.mm.dd.\nbuildNumber=$(date -u \"+%y.%m.%d\")\n/usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $buildNumber\" \"$INFOPLIST_FILE\"\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"$INFOPLIST_FILE\"\n\n# Update the copyright string.\nbuildYear=$(date -u \"+%Y\")\n/usr/libexec/PlistBuddy -c \"Set :NSHumanReadableCopyright Copyright © 2015–$buildYear Thomas Harte.\\nAll rights reserved.\" \"$INFOPLIST_FILE\"\n"; + shellScript = "#!/bin/bash\n\n# Set both version numbers to yy.mm.dd.\nbuildNumber=$(date -u \"+%y.%m.%d\")\n/usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $buildNumber\" \"$INFOPLIST_FILE\"\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"$INFOPLIST_FILE\"\n\n# Update the copyright string.\nbuildYear=$(date -u \"+%Y\")\n/usr/libexec/PlistBuddy -c \"Set :NSHumanReadableCopyright Copyright © 2015–$buildYear Thomas Harte.\\nAll rights reserved.\" \"$INFOPLIST_FILE\"\n"; }; /* End PBXShellScriptBuildPhase section */ From ae8f0d339ee10debf458802ef99b694555e750d8 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 11 Nov 2022 20:29:59 -0500 Subject: [PATCH 2/2] Remove usage of `sprintf`. --- OSBindings/Mac/Clock SignalTests/Comparative68000.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OSBindings/Mac/Clock SignalTests/Comparative68000.hpp b/OSBindings/Mac/Clock SignalTests/Comparative68000.hpp index b85e97248..73bb0c4a4 100644 --- a/OSBindings/Mac/Clock SignalTests/Comparative68000.hpp +++ b/OSBindings/Mac/Clock SignalTests/Comparative68000.hpp @@ -32,7 +32,7 @@ class ComparativeBusHandler: public CPU::MC68000Mk2::BusHandler { // Generate state locally. const auto state = get_state().registers; char local_state[300]; - sprintf(local_state, "%04x: %02x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n", + snprintf(local_state, sizeof(local_state), "%04x: %02x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n", address, state.status, state.data[0], state.data[1], state.data[2], state.data[3], state.data[4], state.data[5], state.data[6], state.data[7],