vidix: Simplify code for writing to /proc/mtrr

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32462 b3059339-0415-0410-9bf9-f77b7e298cf2

Add a missing const to declaration.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32463 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-10-09 12:07:49 +00:00 committed by Uoti Urpala
parent 8fe2291c53
commit ffb69180bb
1 changed files with 3 additions and 7 deletions

View File

@ -41,7 +41,7 @@ int mtrr_set_type(unsigned base,unsigned size,int type)
{
#ifdef __linux__
FILE * mtrr_fd;
char * stype;
const char *stype;
switch(type)
{
case MTRR_TYPE_UNCACHABLE: stype = "uncachable"; break;
@ -54,13 +54,9 @@ int mtrr_set_type(unsigned base,unsigned size,int type)
mtrr_fd = fopen("/proc/mtrr","wt");
if(mtrr_fd)
{
char sout[256];
unsigned wr_len;
sprintf(sout,"base=0x%08X size=0x%08X type=%s\n",base,size,stype);
wr_len = fprintf(mtrr_fd,sout);
/*printf("MTRR: %s\n",sout);*/
int wr_len = fprintf(mtrr_fd, "base=0x%08X size=0x%08X type=%s\n", base, size, stype);
fclose(mtrr_fd);
return wr_len == strlen(sout) ? 0 : EPERM;
return wr_len > 0 ? 0 : EPERM;
}
return ENOSYS;
#elif defined (__i386__ ) && defined (__NetBSD__) && __NetBSD_Version__ > 105240000