diff options
author | OBATA Akio <obache@wizdas.com> | 2019-01-14 18:46:42 +0900 |
---|---|---|
committer | OBATA Akio <obache@wizdas.com> | 2019-01-15 20:18:22 +0900 |
commit | 12ef306abc066e67042c539f7438f37c120a1be8 (patch) | |
tree | a16f2c30a2754c479af4218e7f5046ba031dc284 /kttsd | |
parent | b07694f87257d400c6c74e6f5455c98b3f77a6d9 (diff) | |
download | tdeaccessibility-12ef306abc066e67042c539f7438f37c120a1be8.tar.gz tdeaccessibility-12ef306abc066e67042c539f7438f37c120a1be8.zip |
change large file support to more portable
It is not portable to use lseek64/off64_t directly.
Change to set large file support macro and use usual names.
Signed-off-by: OBATA Akio <obache@wizdas.com>
Diffstat (limited to 'kttsd')
-rw-r--r-- | kttsd/players/alsaplayer/Makefile.am | 2 | ||||
-rw-r--r-- | kttsd/players/alsaplayer/alsaplayer.cpp | 18 | ||||
-rw-r--r-- | kttsd/players/alsaplayer/alsaplayer.h | 8 |
3 files changed, 14 insertions, 14 deletions
diff --git a/kttsd/players/alsaplayer/Makefile.am b/kttsd/players/alsaplayer/Makefile.am index 9653629..48bb6f0 100644 --- a/kttsd/players/alsaplayer/Makefile.am +++ b/kttsd/players/alsaplayer/Makefile.am @@ -2,7 +2,7 @@ INCLUDES = \ -I$(top_srcdir)/kttsd/libkttsd -I$(top_builddir)/kttsd/libkttsd \ $(all_includes) -KDE_CXXFLAGS = -D_LARGEFILE64_SOURCE -D_GNU_SOURCE +KDE_CXXFLAGS = -D_GNU_SOURCE # Let automoc handle all of the metsource files (moc). METASOURCES = AUTO diff --git a/kttsd/players/alsaplayer/alsaplayer.cpp b/kttsd/players/alsaplayer/alsaplayer.cpp index 4222ca6..c9680dd 100644 --- a/kttsd/players/alsaplayer/alsaplayer.cpp +++ b/kttsd/players/alsaplayer/alsaplayer.cpp @@ -1254,7 +1254,7 @@ void AlsaPlayer::voc_play(int fd, int ofs, const char* name) char was_extended = 0, output = 0; u_short *sp, repeat = 0; size_t silence; - off64_t filepos = 0; + off_t filepos = 0; #define COUNT(x) nextblock -= x; in_buffer -= x; data += x #define COUNT1(x) in_buffer -= x; data += x @@ -1385,7 +1385,7 @@ void AlsaPlayer::voc_play(int fd, int ofs, const char* name) MSG("Repeat loop %d times", repeat); #endif if (filepos >= 0) { /* if < 0, one seek fails, why test another */ - if ((filepos = lseek64(fd, 0, 1)) < 0) { + if ((filepos = lseek(fd, 0, 1)) < 0) { ERR("can't play loops; %s isn't seekable", name); repeat = 0; } else { @@ -1407,7 +1407,7 @@ void AlsaPlayer::voc_play(int fd, int ofs, const char* name) else MSG("Neverending loop"); #endif - lseek64(fd, filepos, 0); + lseek(fd, filepos, 0); in_buffer = 0; /* clear the buffer */ goto Fill_the_buffer; } @@ -1471,15 +1471,15 @@ void AlsaPlayer::init_raw_data(void) } /* calculate the data count to read from/to dsp */ -off64_t AlsaPlayer::calc_count(void) +off_t AlsaPlayer::calc_count(void) { - off64_t count; + off_t count; if (timelimit == 0) { count = pbrec_count; } else { count = snd_pcm_format_size(hwdata.format, hwdata.rate * hwdata.channels); - count *= (off64_t)timelimit; + count *= (off_t)timelimit; } return count < pbrec_count ? count : pbrec_count; } @@ -1505,11 +1505,11 @@ void AlsaPlayer::header(int /*rtype*/, const char* /*name*/) /* playing raw data */ -void AlsaPlayer::playback_go(int fd, size_t loaded, off64_t count, int rtype, const char *name) +void AlsaPlayer::playback_go(int fd, size_t loaded, off_t count, int rtype, const char *name) { int l, r; - off64_t written = 0; - off64_t c; + off_t written = 0; + off_t c; if (m_debugLevel >= 1) header(rtype, name); set_params(); diff --git a/kttsd/players/alsaplayer/alsaplayer.h b/kttsd/players/alsaplayer/alsaplayer.h index c1e73c3..6239566 100644 --- a/kttsd/players/alsaplayer/alsaplayer.h +++ b/kttsd/players/alsaplayer/alsaplayer.h @@ -124,9 +124,9 @@ private: void voc_pcm_flush(void); void voc_play(int fd, int ofs, const char *name); void init_raw_data(void); - off64_t calc_count(void); + off_t calc_count(void); void header(int rtype, const char *name); - void playback_go(int fd, size_t loaded, off64_t count, int rtype, const char *name); + void playback_go(int fd, size_t loaded, off_t count, int rtype, const char *name); void playback(int fd); KURL m_currentURL; @@ -168,8 +168,8 @@ private: size_t chunk_bytes; snd_output_t *log; int fd; - off64_t pbrec_count; - off64_t fdcount; + off_t pbrec_count; + off_t fdcount; int vocmajor; int vocminor; |