Skip to content

Commit

Permalink
Windows fixes
Browse files Browse the repository at this point in the history
flake8 fixes
  • Loading branch information
iterumllc committed Jun 25, 2024
1 parent c910ba8 commit 1e35149
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
14 changes: 7 additions & 7 deletions c/sfntedit/sfntedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ void SfntEdit::readHdr() {
default:
srcfile.close();
fatal("unrecognized/unsupported file type [%s]",
srcfilepath.c_str());
srcfilepath.string().c_str());
}

/* Read rest of header */
Expand Down Expand Up @@ -667,7 +667,7 @@ void SfntEdit::readHdr() {
void SfntEdit::dumpHdr(void) {
int i = 0;

std::printf("--- sfnt header [%s]\n", srcfilepath.c_str());
std::printf("--- sfnt header [%s]\n", srcfilepath.string().c_str());
if (sfnt.version == 0x00010000)
std::printf("version =1.0 (00010000)\n");
else
Expand Down Expand Up @@ -781,7 +781,7 @@ void SfntEdit::checkChecksums() {
fail = 1;
}
logger->log(sINFO, fail ? "icheck failed [%s]" : "check passed [%s]",
srcfilepath.c_str());
srcfilepath.string().c_str());
}

/* Make extract filename from option filename or src filename plus table tag */
Expand Down Expand Up @@ -868,7 +868,7 @@ uint32_t SfntEdit::addTable(const Table &tbl, std::ostream &dstfile,

file.open(tbl.afilename, std::ios::binary);
if (file.fail())
fatal("file error <could not open> [%s]", tbl.afilename.c_str());
fatal("file error <could not open> [%s]", tbl.afilename.string().c_str());
file.seekg(0, std::ios::end);
*length = (uint32_t) file.tellg();
checksum = tableCopy(file, dstfile, 0, *length);
Expand Down Expand Up @@ -1019,7 +1019,7 @@ int SfntEdit::run_prot(int argc, char *argv[]) {
scriptfilepath = "sfntedit.scr";

if (!fs::exists(scriptfilepath)) {
fatal("Missing script file [%s]", scriptfilepath.c_str());
fatal("Missing script file [%s]", scriptfilepath.string().c_str());
}
makeArgs(scriptfilepath, script);
if (scriptfilepath.has_parent_path())
Expand Down Expand Up @@ -1059,15 +1059,15 @@ int SfntEdit::run_prot(int argc, char *argv[]) {

srcfile.open(srcfilepath, std::ios::binary);
if (srcfile.fail())
fatal("file error <could not open> [%s]", srcfilepath.c_str());
fatal("file error <could not open> [%s]", srcfilepath.string().c_str());

if (!doingScripting && srcfilepath.has_parent_path())
sourcepath = srcfilepath.parent_path();

if (!dstfilepath.empty()) { // Open destination file
dstfile.open(dstfilepath, std::ios::in|std::ios::out|std::ios::binary|std::ios::trunc);
if (dstfile.fail())
fatal("file error <could not open> [%s]", dstfilepath.c_str());
fatal("file error <could not open> [%s]", dstfilepath.string().c_str());
}

/* Read sfnt header */
Expand Down
2 changes: 0 additions & 2 deletions c/shared/include/designspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
#include <map>
#include <vector>

#include "ctlshare.h"
#include "slogger.h"
#include "supportfp.h"
#include "varsupport.h"

class Designspace {
Expand Down
12 changes: 6 additions & 6 deletions c/shared/include/supportfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
floor, frexp, ldexp, log, log10, modf, pow, sin, sqrt
*/

#include <math.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif

#include "math.h"
#include "stdint.h"

#ifndef FIXEDFUNC
#define FIXEDFUNC
#endif /* FIXEDFUNC */

#ifdef __cplusplus
extern "C" {
#endif

/* Reals and Fixed point */
typedef int32_t Fixed; /* 16 bits of integer, 16 bits of fraction */

Expand Down
3 changes: 2 additions & 1 deletion cmake/ExternalAntlr4Cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ if(NOT DEFINED ANTLR4_TAG)
endif()

if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
set(ANTLR4_OUTPUT_DIR ${ANTLR4_ROOT}/runtime/Cpp/dist/$(Configuration))
# set(ANTLR4_OUTPUT_DIR ${ANTLR4_ROOT}/runtime/Cpp/dist/$(Configuration))
set(ANTLR4_OUTPUT_DIR ${ANTLR4_ROOT}/runtime/Cpp/dist)
elseif(${CMAKE_GENERATOR} MATCHES "Xcode.*")
set(ANTLR4_OUTPUT_DIR ${ANTLR4_ROOT}/runtime/Cpp/dist/$(CONFIGURATION))
else()
Expand Down
5 changes: 3 additions & 2 deletions python/afdko/makeotf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1486,8 +1486,9 @@ def getOptions(makeOTFParams, args):
if error:
raise MakeOTFOptionsError

if (getattr(makeOTFParams, kFileOptPrefix + kRelease) != None and
getattr(makeOTFParams, kFileOptPrefix + kUseSuppliedCFF) != None):
if (getattr(makeOTFParams, kFileOptPrefix + kRelease) is not None and
getattr(makeOTFParams, kFileOptPrefix + kUseSuppliedCFF)
is not None):
setattr(makeOTFParams, kFileOptPrefix + kDoSubr, None)


Expand Down
1 change: 1 addition & 0 deletions tests/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

last_command = ["blah"]


def _write_file(file_path, data):
with open(file_path, "wb") as f:
f.write(data)
Expand Down

0 comments on commit 1e35149

Please sign in to comment.