[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[423] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-21 13:39:59
|
Revision: 423 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=423&view=rev Author: nickols_k Date: 2012-11-21 13:39:45 +0000 (Wed, 21 Nov 2012) Log Message: ----------- cleanups Modified Paths: -------------- mplayerxp/libmpcodecs/vd_ffmpeg.cpp mplayerxp/libmpdemux/mpeg_hdr.cpp mplayerxp/libmpstream/cache2.cpp mplayerxp/libmpstream/s_dvdnav.cpp mplayerxp/libmpstream/stream.cpp mplayerxp/osdep/mp_malloc.cpp mplayerxp/postproc/vf_unsharp.cpp Modified: mplayerxp/libmpcodecs/vd_ffmpeg.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.cpp 2012-11-21 13:21:00 UTC (rev 422) +++ mplayerxp/libmpcodecs/vd_ffmpeg.cpp 2012-11-21 13:39:45 UTC (rev 423) @@ -1,3 +1,5 @@ +#include <algorithm> + #include <ctype.h> #include <stdio.h> #include <stdlib.h> @@ -367,11 +369,11 @@ if (sh->bih->biSize-sizeof(BITMAPINFOHEADER)) /* Palette size in biSize */ memcpy(priv->ctx->palctrl->palette, sh->bih+1, - min(sh->bih->biSize-sizeof(BITMAPINFOHEADER), AVPALETTE_SIZE)); + std::min(sh->bih->biSize-sizeof(BITMAPINFOHEADER), AVPALETTE_SIZE)); else /* Palette size in biClrUsed */ memcpy(priv->ctx->palctrl->palette, sh->bih+1, - min(sh->bih->biClrUsed * 4, AVPALETTE_SIZE)); + std::min(sh->bih->biClrUsed * 4, AVPALETTE_SIZE)); } #endif if(sh->bih) Modified: mplayerxp/libmpdemux/mpeg_hdr.cpp =================================================================== --- mplayerxp/libmpdemux/mpeg_hdr.cpp 2012-11-21 13:21:00 UTC (rev 422) +++ mplayerxp/libmpdemux/mpeg_hdr.cpp 2012-11-21 13:39:45 UTC (rev 423) @@ -1,3 +1,5 @@ +#include <algorithm> + #include "../mp_config.h" // based on libmpeg2/header.c by Aaron Holtzman <aho...@es...> #include <inttypes.h> @@ -213,10 +215,6 @@ return n; } -#ifndef min -#define min(a, b) ((a) <= (b) ? (a) : (b)) -#endif - static unsigned int read_golomb(unsigned char *buffer, unsigned int *init) { unsigned int x, v = 0, v2 = 0, m, len = 0, n = *init; @@ -227,7 +225,7 @@ x = len + n; while(n < x) { - m = min(x - n, 8); + m = std::min(x - n, unsigned(8)); v |= getbits(buffer, n, m); n += m; if(x - n > 8) Modified: mplayerxp/libmpstream/cache2.cpp =================================================================== --- mplayerxp/libmpstream/cache2.cpp 2012-11-21 13:21:00 UTC (rev 422) +++ mplayerxp/libmpstream/cache2.cpp 2012-11-21 13:39:45 UTC (rev 423) @@ -1,3 +1,5 @@ +#include <algorithm> + #include "mp_config.h" #define READ_USLEEP_TIME 10000 @@ -26,10 +28,6 @@ #include "mplayerxp.h" #include "stream_msg.h" -#ifndef min -#define min(a,b) ((a)<(b)?(a):(b)) -#endif - #define CPF_EMPTY 0x00000001UL #define CPF_EOF 0x80000000UL #define CPF_DONE 0x40000000UL /* special case for dvd packets to exclude them from sending again */ @@ -512,7 +510,7 @@ if(mp_conf.verbose>2) { MSG_DBG2( "c2_stream_read got %u bytes ",total); - for(i=0;i<min(8,total);i++) MSG_DBG2("%02X ",(int)((unsigned char)_mem[i])); + for(i=0;i<std::min(8,total);i++) MSG_DBG2("%02X ",(int)((unsigned char)_mem[i])); MSG_DBG2("\n"); } return total; Modified: mplayerxp/libmpstream/s_dvdnav.cpp =================================================================== --- mplayerxp/libmpstream/s_dvdnav.cpp 2012-11-21 13:21:00 UTC (rev 422) +++ mplayerxp/libmpstream/s_dvdnav.cpp 2012-11-21 13:39:45 UTC (rev 423) @@ -13,6 +13,8 @@ #include "libvo/sub.h" #include "input2/input.h" #include "mplayerxp.h" +#include <algorithm> + #include "stream_msg.h" #include <dvdnav/dvdnav.h> @@ -23,13 +25,6 @@ #include "mrl.h" #define DVD_BLOCK_SIZE 2048 -#ifndef min -#define min(a,b) ((a)<(b)?(a):(b)) -#endif -#ifndef max -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - extern vo_data_t* vo_data; typedef struct { @@ -470,10 +465,10 @@ btni_t *btni = &(pnavpci->hli.btnit[btnum]); if (priv->hlev.buttonN == (unsigned)btnum + 1) { - priv->hlev.sx = min (btni->x_start, btni->x_end); - priv->hlev.ex = max (btni->x_start, btni->x_end); - priv->hlev.sy = min (btni->y_start, btni->y_end); - priv->hlev.ey = max (btni->y_start, btni->y_end); + priv->hlev.sx = std::min (btni->x_start, btni->x_end); + priv->hlev.ex = std::max (btni->x_start, btni->x_end); + priv->hlev.sy = std::min (btni->y_start, btni->y_end); + priv->hlev.ey = std::max (btni->y_start, btni->y_end); priv->hlev.palette = (btni->btn_coln == 0) ? 0 : pnavpci->hli.btn_colit.btn_coli[btni->btn_coln - 1][0]; Modified: mplayerxp/libmpstream/stream.cpp =================================================================== --- mplayerxp/libmpstream/stream.cpp 2012-11-21 13:21:00 UTC (rev 422) +++ mplayerxp/libmpstream/stream.cpp 2012-11-21 13:39:45 UTC (rev 423) @@ -1,3 +1,5 @@ +#include <algorithm> + #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -21,10 +23,6 @@ #include "libmpdemux/demuxer.h" #include "stream_msg.h" -#ifndef min -#define min(a,b) ((a)<(b)?(a):(b)) -#endif - #ifdef HAVE_LIBCDIO_CDDA extern const stream_driver_t cdda_stream; extern const stream_driver_t cddb_stream; @@ -281,7 +279,7 @@ x=s->buf_len-s->buf_pos; if(x>0) { - ilen=min(_total,x); + ilen=std::min(_total,x); memcpy(mem,&s->buffer[s->buf_pos],ilen); MSG_DBG3("nc_stream_read: copy prefetched %u bytes\n",ilen); s->buf_pos+=ilen; @@ -312,10 +310,10 @@ s->buffer=(unsigned char *)mem; s->buf_len=rlen; nc_stream_read_cbuffer(s); - mem += min(rlen,(int)s->buf_len); + mem += std::min(rlen,(int)s->buf_len); tile=s->buf_len-rlen; - rlen -= min(rlen,(int)s->buf_len); - got_len += min(rlen,(int)s->buf_len); + rlen -= std::min(rlen,(int)s->buf_len); + got_len += std::min(rlen,(int)s->buf_len); eof=stream_eof(s); if(eof) break; stat++; @@ -330,8 +328,8 @@ /* should never happen. Store data back to native cache! */ MSG_DBG3("nc_stream_read: we have tile %u bytes\n",tile); s->buf_pos=0; - memcpy(s->buffer,&mem[s->buf_len-tile],min(STREAM_BUFFER_SIZE,tile)); - s->buf_len=min(STREAM_BUFFER_SIZE,tile); + memcpy(s->buffer,&mem[s->buf_len-tile],std::min(int(STREAM_BUFFER_SIZE),tile)); + s->buf_len=std::min(int(STREAM_BUFFER_SIZE),tile); } } ilen=_total-ilen; @@ -349,7 +347,7 @@ mem+=x; ilen-=x; } MSG_DBG3( "nc_stream_read got %u bytes ",total); - for(i=0;i<min(8,total);i++) MSG_DBG3("%02X ",(int)((unsigned char)mem[i])); + for(i=0;i<std::min(8,total);i++) MSG_DBG3("%02X ",(int)((unsigned char)mem[i])); MSG_DBG3("\n"); return total; } Modified: mplayerxp/osdep/mp_malloc.cpp =================================================================== --- mplayerxp/osdep/mp_malloc.cpp 2012-11-21 13:21:00 UTC (rev 422) +++ mplayerxp/osdep/mp_malloc.cpp 2012-11-21 13:39:45 UTC (rev 423) @@ -1,3 +1,5 @@ +#include <algorithm> + #include "mp_config.h" #include "mplib.h" #define MSGT_CLASS MSGT_OSDEP @@ -223,7 +225,6 @@ prot_free_slot(&priv->mallocs,page_ptr); } -#define min(a,b) ((a)<(b)?(a):(b)) static any_t* __prot_realloc_append(any_t*ptr,size_t size) { any_t* rp; if((rp=__prot_malloc_append(size))!=NULL && ptr) { @@ -234,7 +235,7 @@ __print_backtrace(10); kill(getpid(), SIGILL); } - memcpy(rp,ptr,min(slot->size,size)); + memcpy(rp,ptr,std::min(slot->size,size)); __prot_free_append(ptr); } return rp; @@ -283,7 +284,7 @@ __print_backtrace(10); kill(getpid(), SIGILL); } - memcpy(rp,ptr,min(slot->size,size)); + memcpy(rp,ptr,std::min(slot->size,size)); __prot_free_prepend(ptr); } return rp; @@ -379,14 +380,14 @@ int printable=1; MSG_INFO("address: %p size: %u dump: ",c->slots[i].page_ptr,c->slots[i].size); s=reinterpret_cast<char *>(c->slots[i].page_ptr); - for(j=0;j<min(c->slots[i].size,20);j++) { + for(j=0;j<std::min(c->slots[i].size,size_t(20));j++) { if(!isprint(s[j])) { printable=0; break; } } if(printable) MSG_INFO("%20s",s); - else for(j=0;j<min(c->slots[i].size,10);j++) { + else for(j=0;j<std::min(c->slots[i].size,size_t(10));j++) { MSG_INFO("%02X ",(unsigned char)s[j]); } MSG_INFO("\n"); Modified: mplayerxp/postproc/vf_unsharp.cpp =================================================================== --- mplayerxp/postproc/vf_unsharp.cpp 2012-11-21 13:21:00 UTC (rev 422) +++ mplayerxp/postproc/vf_unsharp.cpp 2012-11-21 13:39:45 UTC (rev 423) @@ -16,6 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <algorithm> #include <stdio.h> #include <stdlib.h> @@ -37,13 +38,6 @@ #include "osdep/mplib.h" #include "pp_msg.h" -#ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) -#endif -#ifndef MAX -#define MAX(a,b) (((a)>(b))?(a):(b)) -#endif - //===========================================================================// #define MIN_MATRIX_SIZE 3 @@ -297,8 +291,8 @@ fp->msizeY = ( z && z+1<max ) ? atoi( pos=z+1 ) : fp->msizeX; // min/max & odd - fp->msizeX = 1 | MIN( MAX( fp->msizeX, MIN_MATRIX_SIZE ), MAX_MATRIX_SIZE ); - fp->msizeY = 1 | MIN( MAX( fp->msizeY, MIN_MATRIX_SIZE ), MAX_MATRIX_SIZE ); + fp->msizeX = 1 | std::min( std::max( fp->msizeX, MIN_MATRIX_SIZE ), MAX_MATRIX_SIZE ); + fp->msizeY = 1 | std::min( std::max( fp->msizeY, MIN_MATRIX_SIZE ), MAX_MATRIX_SIZE ); // parse amount pos = strchr( pos+1, ':' ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |