-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3001416: Fix -Wimplicit-int-float-conversion.
- Loading branch information
1 parent
bc4b064
commit b2e9f22
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
build_conditionally_import_ext_headers_from_framework_or_from.patch | ||
chore_explicitly_cast_long_max_to_double.patch |
26 changes: 26 additions & 0 deletions
26
patches/ReactiveObjC/chore_explicitly_cast_long_max_to_double.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Shelley Vohr <shelley.vohr@gmail.com> | ||
Date: Thu, 15 Jul 2021 15:53:08 -0400 | ||
Subject: chore: explicitly cast LONG_MAX to double | ||
|
||
Fixes a compilation error encountered in Electron as a result of | ||
Chromium enabling the -Wimplicit-const-int-float-conversion compilation | ||
flag in https://chromium-review.googlesource.com/c/chromium/src/+/3001416. | ||
|
||
Upstreamed at https://github.com/ReactiveCocoa/ReactiveObjC/pull/186. | ||
|
||
diff --git a/ReactiveObjC/RACQueueScheduler.m b/ReactiveObjC/RACQueueScheduler.m | ||
index d9dd189b8fab73f412b2d2fc831041a33368d491..bc6e8d1b5339197c173a1254c0586621dfe5b591 100644 | ||
--- a/ReactiveObjC/RACQueueScheduler.m | ||
+++ b/ReactiveObjC/RACQueueScheduler.m | ||
@@ -48,8 +48,8 @@ + (dispatch_time_t)wallTimeWithDate:(NSDate *)date { | ||
double frac = modf(date.timeIntervalSince1970, &seconds); | ||
|
||
struct timespec walltime = { | ||
- .tv_sec = (time_t)fmin(fmax(seconds, LONG_MIN), LONG_MAX), | ||
- .tv_nsec = (long)fmin(fmax(frac * NSEC_PER_SEC, LONG_MIN), LONG_MAX) | ||
+ .tv_sec = (time_t)fmin(fmax(seconds, LONG_MIN), (double)LONG_MAX), | ||
+ .tv_nsec = (long)fmin(fmax(frac * NSEC_PER_SEC, LONG_MIN), (double)LONG_MAX) | ||
}; | ||
|
||
return dispatch_walltime(&walltime, 0); |