From eae942b7b4ed36f5f43edd20ae6abd9e923b96c0 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 22 Jan 2013 16:46:29 +0000 Subject: merge in Win32 UTF-8 file/path support svn path=/trunk/externals/miXed/; revision=16950 --- cyclone/Makefile.libdir | 2 +- cyclone/hammer/capture.c | 2 +- cyclone/hammer/coll.c | 6 ++---- cyclone/hammer/mtr.c | 6 ++---- cyclone/hammer/seq.c | 4 +--- cyclone/sickle/capture.c | 2 +- shared/common/mifi.c | 6 ++---- shared/common/os.c | 6 ++---- shared/common/port.c | 2 +- 9 files changed, 13 insertions(+), 23 deletions(-) diff --git a/cyclone/Makefile.libdir b/cyclone/Makefile.libdir index eacff54..920c080 100644 --- a/cyclone/Makefile.libdir +++ b/cyclone/Makefile.libdir @@ -113,7 +113,7 @@ endif cyclone: $(MAKE) -f Makefile \ - OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing -fPIC" + OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing -Wstrict-aliasing=2 -fPIC" install: cyclone $(INSTALL_DIR) $(DESTDIR)$(objectsdir)/cyclone diff --git a/cyclone/hammer/capture.c b/cyclone/hammer/capture.c index 7598a59..69e44f0 100644 --- a/cyclone/hammer/capture.c +++ b/cyclone/hammer/capture.c @@ -137,7 +137,7 @@ static void capture_dowrite(t_capture *x, t_symbol *fn) int count = x->x_count; char buf[MAXPDSTRING]; canvas_makefilename(x->x_canvas, fn->s_name, buf, MAXPDSTRING); - if (fp = fopen(buf, "w")) /* LATER ask if overwriting, CHECKED */ + if (fp = sys_fopen(buf, "w")) /* LATER ask if overwriting, CHECKED */ { int col = 0; if (count < x->x_bufsize) diff --git a/cyclone/hammer/coll.c b/cyclone/hammer/coll.c index fc81b30..89112ce 100644 --- a/cyclone/hammer/coll.c +++ b/cyclone/hammer/coll.c @@ -601,11 +601,9 @@ static void collcommon_doread(t_collcommon *cc, t_symbol *fn, t_canvas *cv) /* loading during object creation -- avoid binbuf_read()'s complaints, LATER rethink */ FILE *fp; - char fname[MAXPDSTRING]; - sys_bashfilename(buf, fname); - if (!(fp = fopen(fname, "r"))) + if (!(fp = sys_fopen(buf, "r"))) { - loud_warning(&coll_class, 0, "no coll file '%s'", fname); + loud_warning(&coll_class, 0, "no coll file '%s'", buf); return; } fclose(fp); diff --git a/cyclone/hammer/mtr.c b/cyclone/hammer/mtr.c index 15dc5f6..0d04efa 100644 --- a/cyclone/hammer/mtr.c +++ b/cyclone/hammer/mtr.c @@ -488,8 +488,7 @@ static void mtr_doread(t_mtr *x, t_mtrack *target, t_symbol *fname) path[MAXPDSTRING-1] = 0; } /* CHECKED no global message */ - sys_bashfilename(path, path); - if (fp = fopen(path, "r")) + if (fp = sys_fopen(path, "r")) { t_mtrack *tp = 0; char linebuf[MTR_FILEBUFSIZE]; @@ -637,8 +636,7 @@ static void mtr_dowrite(t_mtr *x, t_mtrack *source, t_symbol *fname) path[MAXPDSTRING-1] = 0; } /* CHECKED no global message */ - sys_bashfilename(path, path); - if (fp = fopen(path, "w")) + if (fp = sys_fopen(path, "w")) { /* CHECKED single-track writing does not seem to work (a bug?) */ if (source) failed = mtr_writetrack(x, source, fp); diff --git a/cyclone/hammer/seq.c b/cyclone/hammer/seq.c index ce8c0a4..fd5688d 100644 --- a/cyclone/hammer/seq.c +++ b/cyclone/hammer/seq.c @@ -1017,9 +1017,7 @@ static void seq_doread(t_seq *x, t_symbol *fn, int creation) /* loading during object creation -- CHECKED no warning if a file specified with an arg does not exist, LATER rethink */ FILE *fp; - char path[MAXPDSTRING]; - sys_bashfilename(buf, path); - if (!(fp = fopen(path, "r"))) + if (!(fp = sys_fopen(buf, "r"))) return; fclose(fp); } diff --git a/cyclone/sickle/capture.c b/cyclone/sickle/capture.c index 8f8f5a0..a613694 100644 --- a/cyclone/sickle/capture.c +++ b/cyclone/sickle/capture.c @@ -75,7 +75,7 @@ static void capture_dowrite(t_capture *x, t_symbol *fn) char buf[MAXPDSTRING]; canvas_makefilename(glist_getcanvas(x->x_glist), fn->s_name, buf, MAXPDSTRING); - if (fp = fopen(buf, "w")) /* LATER ask if overwriting, CHECKME */ + if (fp = sys_fopen(buf, "w")) /* LATER ask if overwriting, CHECKME */ { int col = 0; if (x->x_mode == 'f' || count < x->x_bufsize) diff --git a/shared/common/mifi.c b/shared/common/mifi.c index c0a7178..4da9f55 100644 --- a/shared/common/mifi.c +++ b/shared/common/mifi.c @@ -545,8 +545,7 @@ static int mifiread_startfile(t_mifiread *mr, const char *filename, if (fnameptr != slashpos) strcpy(slashpos, fnameptr); } - sys_bashfilename(path, path); - if (!(mr->mr_fp = fopen(path, "rb"))) + if (!(mr->mr_fp = sys_fopen(path, "rb"))) { strcpy(errmess, "cannot open"); goto rstartfailed; @@ -1328,8 +1327,7 @@ int mifiwrite_open(t_mifiwrite *mw, const char *filename, if (*dirname) strcat(fnamebuf, dirname), strcat(fnamebuf, "/"); strcat(fnamebuf, filename); - sys_bashfilename(fnamebuf, fnamebuf); - if (!(mw->mw_fp = fopen(fnamebuf, "wb"))) + if (!(mw->mw_fp = sys_fopen(fnamebuf, "wb"))) { strcpy(errmess, "cannot open"); goto wopenfailed; diff --git a/shared/common/os.c b/shared/common/os.c index 408fdfb..9737949 100644 --- a/shared/common/os.c +++ b/shared/common/os.c @@ -216,8 +216,7 @@ FILE *fileread_open(char *filename, t_canvas *cv, int textmode) if (nameptr != slashpos) strcpy(slashpos, nameptr); } - sys_bashfilename(path, path); - return (fopen(path, (textmode ? "r" : "rb"))); + return (sys_fopen(path, (textmode ? "r" : "rb"))); } FILE *filewrite_open(char *filename, t_canvas *cv, int textmode) @@ -231,8 +230,7 @@ FILE *filewrite_open(char *filename, t_canvas *cv, int textmode) strncpy(path, filename, MAXPDSTRING); path[MAXPDSTRING-1] = 0; } - sys_bashfilename(path, path); - return (fopen(path, (textmode ? "w" : "wb"))); + return (sys_fopen(path, (textmode ? "w" : "wb"))); } /* FIXME add MSW */ diff --git a/shared/common/port.c b/shared/common/port.c index fe58b6e..bcfddf3 100644 --- a/shared/common/port.c +++ b/shared/common/port.c @@ -953,7 +953,7 @@ static int imaction_K1_replace(t_port *x, char *arg) sprintf(buf, "port-%02d.pict", ++x->x_pictno); if (x->x_dumping) { - if (x->x_pictfp = fopen(buf, "wb")) + if (x->x_pictfp = sys_fopen(buf, "wb")) { int i; for (i = 0; i < 512; i++) fputc(0, x->x_pictfp); -- cgit v1.2.1