Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ffried committed Mar 29, 2022
1 parent c47d919 commit 6d52fa6
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 41 deletions.
10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import PackageDescription
let package = Package(
name: "simple-formatting",
products: [
.library(name: "SimpleDurationFormatting",
targets: ["SimpleDurationFormatting"]),
.library(name: "DurationFormatting",
targets: ["DurationFormatting"]),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down Expand Up @@ -49,13 +49,13 @@ let package = Package(
// "CICUIO",
]),
.target(
name: "SimpleDurationFormatting",
name: "DurationFormatting",
dependencies: ["CICUShims"]),
.testTarget(
name: "SimpleDurationFormattingTests",
name: "DurationFormattingTests",
dependencies: [
"CICUShims",
"SimpleDurationFormatting",
"DurationFormatting",
]),
],
cxxLanguageStandard: .cxx14
Expand Down
10 changes: 5 additions & 5 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import PackageDescription
let package = Package(
name: "simple-formatting",
products: [
.library(name: "SimpleDurationFormatting",
targets: ["SimpleDurationFormatting"]),
.library(name: "DurationFormatting",
targets: ["DurationFormatting"]),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down Expand Up @@ -49,13 +49,13 @@ let package = Package(
// "CICUIO",
]),
.target(
name: "SimpleDurationFormatting",
name: "DurationFormatting",
dependencies: ["CICUShims"]),
.testTarget(
name: "SimpleDurationFormattingTests",
name: "DurationFormattingTests",
dependencies: [
"CICUShims",
"SimpleDurationFormatting",
"DurationFormatting",
]),
],
cxxLanguageStandard: .cxx14
Expand Down
4 changes: 0 additions & 4 deletions Sources/CICUCommon/CICUCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@
//#include <unicode/utypes.h>
//#include <unicode/unistr.h>
//#include <unicode/locid.h>
//#include <unicode/numberformatter.h>
//#include <unicode/measfmt.h>
//#include <unicode/msgfmt.h>
//#include <unicode/rbnf.h>

#endif /* CICUCommon_h */
1 change: 1 addition & 0 deletions Sources/CICUCommon/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module CICUCommon [system] {
requires cplusplus11
umbrella header "CICUCommon.h"
link "icuuc"
}
8 changes: 0 additions & 8 deletions Sources/CICUData/CICUData.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
#ifndef CICUData_h
#define CICUData_h

//#include <unicode/utypes.h>
//#include <unicode/unistr.h>
//#include <unicode/locid.h>
//#include <unicode/numberformatter.h>
//#include <unicode/measfmt.h>
//#include <unicode/msgfmt.h>
//#include <unicode/rbnf.h>

#endif /* CICUData_h */
1 change: 1 addition & 0 deletions Sources/CICUData/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module CICUData [system] {
requires cplusplus11
umbrella header "CICUData.h"
link "icudata"
}
3 changes: 0 additions & 3 deletions Sources/CICUI18N/CICUI18N.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef CICUI18N_h
#define CICUI18N_h

//#include <unicode/utypes.h>
//#include <unicode/unistr.h>
//#include <unicode/locid.h>
//#include <unicode/numberformatter.h>
//#include <unicode/measfmt.h>
//#include <unicode/msgfmt.h>
Expand Down
1 change: 1 addition & 0 deletions Sources/CICUI18N/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module CICUI18N [system] {
requires cplusplus11
umbrella header "CICUI18N.h"
link "icui18n"
}
8 changes: 0 additions & 8 deletions Sources/CICUIO/CICUIO.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
#ifndef CICUIO_h
#define CICUIO_h

//#include <unicode/utypes.h>
//#include <unicode/unistr.h>
//#include <unicode/locid.h>
//#include <unicode/numberformatter.h>
//#include <unicode/measfmt.h>
//#include <unicode/msgfmt.h>
//#include <unicode/rbnf.h>

#endif /* CICUIO_h */
1 change: 1 addition & 0 deletions Sources/CICUIO/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module CICUIO [system] {
requires cplusplus11
umbrella header "CICUIO.h"
link "icuio"
}
4 changes: 2 additions & 2 deletions Sources/CICUShims/DurationFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ _CICUResultTypeImpl(Formatting, const char * CICUNonnull, true);

CICUFormattingResult _cicu_makeResultFromUnicodeString(UErrorCode status, icu::UnicodeString str) {
if (U_FAILURE(status)) return CICUFormattingResultMakeFailure(status);
// FIXME: Is there a way to use const char directly?
// FIXME: Is there a way to use (const) char directly?
std::string outBuf;
str.toUTF8String(outBuf);
char *coutBuf = (char *)calloc(outBuf.length() + 1, sizeof(char));
auto copied = outBuf.copy(coutBuf, outBuf.length());
assert(copied == outBuf.length() || "Incomplete string copy!");
assert(copied == outBuf.length() && "Incomplete string copy!");
return CICUFormattingResultMake(status, coutBuf);
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/CICUShims/include/Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
#endif

#ifndef cicu_swift_newtype
#if __has_attribute(__swift_newtype__)
#if __has_attribute(__swift_newtype__) && !defined(CICU_NO_SWIFT_ANNOTATIONS)
#define cicu_swift_newtype(type) __attribute__((__swift_newtype__(type)))
#else
#define cicu_swift_newtype(type)
Expand Down
2 changes: 1 addition & 1 deletion Sources/CICUShims/include/TimeComponents.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TimeComponents_h
#define TimeComponents_h

#include "stdbool.h"
#include <stdbool.h>
#include "Defines.h"

#ifdef __cplusplus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public struct TimeComponents {
}
}

public struct SimpleDurationFormatter {
public struct DurationFormatter {
public enum Width {
case numeric, short, narrow

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import XCTest
import CICUShims
import SimpleDurationFormatting
import DurationFormatting

final class SimpleDurationFormattingTests: XCTestCase {
final class DurationFormattingTests: XCTestCase {
private func _testTimeComponents(_ timeComponents: TimeComponents,
with formatter: SimpleDurationFormatter,
with formatter: DurationFormatter,
expecting result: String,
file: StaticString = #filePath,
line: UInt = #line) {
Expand Down

0 comments on commit 6d52fa6

Please sign in to comment.