diff options
author | Måns Rullgård <mans@mansr.com> | 2006-12-06 23:46:11 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2006-12-06 23:46:11 +0000 |
commit | 8da9266ceaeb233a757d5ad8772bdf93601eec33 (patch) | |
tree | a549b588fbd30273b27aa1f7a4857f010f36a323 | |
parent | cd107896911a1a2359b29f8041458a192631292f (diff) | |
download | ffmpeg-8da9266ceaeb233a757d5ad8772bdf93601eec33.tar.gz |
use the standard INT64_C() macro for 64-bit constants
Originally committed as revision 7240 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/avcodec.h | 2 | ||||
-rw-r--r-- | libavcodec/mpegaudiodec.c | 2 | ||||
-rw-r--r-- | libavcodec/mpegvideo.c | 6 | ||||
-rw-r--r-- | libavformat/asf-enc.c | 10 | ||||
-rw-r--r-- | libavformat/avformat.h | 4 | ||||
-rw-r--r-- | libavformat/avienc.c | 2 | ||||
-rw-r--r-- | libavformat/ffm.c | 2 | ||||
-rw-r--r-- | libavformat/grab.c | 6 | ||||
-rw-r--r-- | libavformat/os_support.c | 4 | ||||
-rw-r--r-- | libavformat/utils.c | 2 | ||||
-rw-r--r-- | libavformat/v4l2.c | 2 | ||||
-rw-r--r-- | libavutil/common.h | 6 | ||||
-rw-r--r-- | libavutil/internal.h | 4 |
13 files changed, 26 insertions, 26 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 21e81dd1ae..4fefcb11a2 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -43,7 +43,7 @@ extern "C" { #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) -#define AV_NOPTS_VALUE int64_t_C(0x8000000000000000) +#define AV_NOPTS_VALUE INT64_C(0x8000000000000000) #define AV_TIME_BASE 1000000 #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 54bcee3b08..a0627e5a43 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -327,7 +327,7 @@ static int decode_init(AVCodecContext * avctx) for(i=0;i<15;i++) { int n, norm; n = i + 2; - norm = ((int64_t_C(1) << n) * FRAC_ONE) / ((1 << n) - 1); + norm = ((INT64_C(1) << n) * FRAC_ONE) / ((1 << n) - 1); scale_factor_mult[i][0] = MULL(FIXR(1.0 * 2.0), norm); scale_factor_mult[i][1] = MULL(FIXR(0.7937005259 * 2.0), norm); scale_factor_mult[i][2] = MULL(FIXR(0.6299605249 * 2.0), norm); diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index f0a04a4029..af34bffbad 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -132,7 +132,7 @@ static void convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[ /* (1<<36)/19952 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= (1<<36)/249205026 */ /* 3444240 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= 275 */ - qmat[qscale][i] = (int)((uint64_t_C(1) << QMAT_SHIFT) / + qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) / (qscale * quant_matrix[j])); } } else if (dsp->fdct == fdct_ifast @@ -147,7 +147,7 @@ static void convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[ /* (1<<36)/19952 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= (1<<36)/249205026 */ /* 3444240 >= (1<<36)/(aanscales[i] * qscale * quant_matrix[i]) >= 275 */ - qmat[qscale][i] = (int)((uint64_t_C(1) << (QMAT_SHIFT + 14)) / + qmat[qscale][i] = (int)((UINT64_C(1) << (QMAT_SHIFT + 14)) / (aanscales[i] * qscale * quant_matrix[j])); } } else { @@ -158,7 +158,7 @@ static void convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[ so (1<<19) / 16 >= (1<<19) / (qscale * quant_matrix[i]) >= (1<<19) / 7905 so 32768 >= (1<<19) / (qscale * quant_matrix[i]) >= 67 */ - qmat[qscale][i] = (int)((uint64_t_C(1) << QMAT_SHIFT) / (qscale * quant_matrix[j])); + qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) / (qscale * quant_matrix[j])); // qmat [qscale][i] = (1 << QMAT_SHIFT_MMX) / (qscale * quant_matrix[i]); qmat16[qscale][0][i] = (1 << QMAT_SHIFT_MMX) / (qscale * quant_matrix[j]); diff --git a/libavformat/asf-enc.c b/libavformat/asf-enc.c index 3ef67507f4..b6162b7dda 100644 --- a/libavformat/asf-enc.c +++ b/libavformat/asf-enc.c @@ -269,8 +269,8 @@ static int64_t unix_to_file_time(int ti) { int64_t t; - t = ti * int64_t_C(10000000); - t += int64_t_C(116444736000000000); + t = ti * INT64_C(10000000); + t += INT64_C(116444736000000000); return t; } @@ -739,7 +739,7 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; if (pts == AV_NOPTS_VALUE) { if (codec->codec_type == CODEC_TYPE_AUDIO) { - duration = (codec->frame_number * (int64_t)codec->frame_size * int64_t_C(10000000)) / + duration = (codec->frame_number * (int64_t)codec->frame_size * INT64_C(10000000)) / codec->sample_rate; } else { duration = av_rescale(codec->frame_number * (int64_t)codec->time_base.num, 10000000, codec->time_base.den); @@ -755,8 +755,8 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) /* check index */ if ((!asf->is_streamed) && (codec->codec_type == CODEC_TYPE_VIDEO) && (pkt->flags & PKT_FLAG_KEY)) { - start_sec = (int)(duration / int64_t_C(10000000)); - if (start_sec != (int)(asf->last_indexed_pts / int64_t_C(10000000))) { + start_sec = (int)(duration / INT64_C(10000000)); + if (start_sec != (int)(asf->last_indexed_pts / INT64_C(10000000))) { for(i=asf->nb_index_count;i<start_sec;i++) { if (i>=asf->nb_index_memory_alloc) { asf->nb_index_memory_alloc += ASF_INDEX_BLOCK; diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 5dc41d2735..818d0729a5 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -40,11 +40,11 @@ extern "C" { /* packet functions */ #ifndef MAXINT64 -#define MAXINT64 int64_t_C(0x7fffffffffffffff) +#define MAXINT64 INT64_C(0x7fffffffffffffff) #endif #ifndef MININT64 -#define MININT64 int64_t_C(0x8000000000000000) +#define MININT64 INT64_C(0x8000000000000000) #endif typedef struct AVPacket { diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 2966087043..2bc7794a3d 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -163,7 +163,7 @@ static int avi_write_header(AVFormatContext *s) nb_frames = 0; if(video_enc){ - put_le32(pb, (uint32_t)(int64_t_C(1000000) * video_enc->time_base.num / video_enc->time_base.den)); + put_le32(pb, (uint32_t)(INT64_C(1000000) * video_enc->time_base.num / video_enc->time_base.den)); } else { put_le32(pb, 0); } diff --git a/libavformat/ffm.c b/libavformat/ffm.c index 539b45d5ff..6d45326190 100644 --- a/libavformat/ffm.c +++ b/libavformat/ffm.c @@ -469,7 +469,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) ffm->file_size = url_fsize(pb); adjust_write_index(s); } else { - ffm->file_size = (uint64_t_C(1) << 63) - 1; + ffm->file_size = (UINT64_C(1) << 63) - 1; } nb_streams = get_be32(pb); diff --git a/libavformat/grab.c b/libavformat/grab.c index 4e85772e5f..2b7c5502c6 100644 --- a/libavformat/grab.c +++ b/libavformat/grab.c @@ -321,16 +321,16 @@ static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt) struct timespec ts; /* Calculate the time of the next frame */ - s->time_frame += int64_t_C(1000000); + s->time_frame += INT64_C(1000000); /* wait based on the frame rate */ for(;;) { curtime = av_gettime(); delay = s->time_frame * s->frame_rate_base / s->frame_rate - curtime; if (delay <= 0) { - if (delay < int64_t_C(-1000000) * s->frame_rate_base / s->frame_rate) { + if (delay < INT64_C(-1000000) * s->frame_rate_base / s->frame_rate) { /* printf("grabbing is %d frames late (dropping)\n", (int) -(delay / 16666)); */ - s->time_frame += int64_t_C(1000000); + s->time_frame += INT64_C(1000000); } break; } diff --git a/libavformat/os_support.c b/libavformat/os_support.c index a66c867f08..5d50e75b68 100644 --- a/libavformat/os_support.c +++ b/libavformat/os_support.c @@ -42,11 +42,11 @@ int64_t av_gettime(void) { #if defined(CONFIG_WINCE) - return timeGetTime() * int64_t_C(1000); + return timeGetTime() * INT64_C(1000); #elif defined(__MINGW32__) struct timeb tb; _ftime(&tb); - return ((int64_t)tb.time * int64_t_C(1000) + (int64_t)tb.millitm) * int64_t_C(1000); + return ((int64_t)tb.time * INT64_C(1000) + (int64_t)tb.millitm) * INT64_C(1000); #else struct timeval tv; gettimeofday(&tv,NULL); diff --git a/libavformat/utils.c b/libavformat/utils.c index 16bc55358e..55ed07414d 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2758,7 +2758,7 @@ int64_t parse_date(const char *datestr, int duration) if (duration) return 0; else - return now * int64_t_C(1000000); + return now * INT64_C(1000000); } if (duration) { diff --git a/libavformat/v4l2.c b/libavformat/v4l2.c index 00adccaa80..d6384e1e05 100644 --- a/libavformat/v4l2.c +++ b/libavformat/v4l2.c @@ -316,7 +316,7 @@ static int mmap_read_frame(struct video_data *s, void *frame, int64_t *ts) /* Image is at s->buff_start[buf.index] */ memcpy(frame, s->buf_start[buf.index], buf.bytesused); - *ts = buf.timestamp.tv_sec * int64_t_C(1000000) + buf.timestamp.tv_usec; + *ts = buf.timestamp.tv_sec * INT64_C(1000000) + buf.timestamp.tv_usec; res = ioctl (s->fd, VIDIOC_QBUF, &buf); if (res < 0) { diff --git a/libavutil/common.h b/libavutil/common.h index 30cc30e7bb..65573f0998 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -53,9 +53,9 @@ # include <inttypes.h> -#ifndef int64_t_C -#define int64_t_C(c) (c ## LL) -#define uint64_t_C(c) (c ## ULL) +#ifndef INT64_C +#define INT64_C(c) (c ## LL) +#define UINT64_C(c) (c ## ULL) #endif #if defined(__MINGW32__) && !defined(BUILD_AVUTIL) && defined(BUILD_SHARED_AV) diff --git a/libavutil/internal.h b/libavutil/internal.h index bf7d0ebca3..b9299bf05c 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -107,11 +107,11 @@ #endif #ifndef INT64_MAX -#define INT64_MAX int64_t_C(9223372036854775807) +#define INT64_MAX INT64_C(9223372036854775807) #endif #ifndef UINT64_MAX -#define UINT64_MAX uint64_t_C(0xFFFFFFFFFFFFFFFF) +#define UINT64_MAX UINT64_C(0xFFFFFFFFFFFFFFFF) #endif #ifndef INT_BIT |