MWS_SRX644: migrate branch mws_srx644 -> HEAD

This commit is contained in:
Jens-Heiner Rechtien
2003-03-19 15:03:25 +00:00
parent ca07344a99
commit a832295be4
5 changed files with 45 additions and 31 deletions

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: global.cxx,v $ * $RCSfile: global.cxx,v $
* *
* $Revision: 1.16 $ * $Revision: 1.17 $
* *
* last change: $Author: hr $ $Date: 2002-08-20 13:51:40 $ * last change: $Author: hr $ $Date: 2003-03-19 15:53:41 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -111,7 +111,7 @@ OString makeTempName(sal_Char* prefix)
OUString uPattern; OUString uPattern;
sal_Char* pPrefix = "cmk_"; sal_Char* pPrefix = "cmk_";
sal_Char tmpPattern[512]; sal_Char tmpPattern[512] = "";
sal_Char *pTmpName = NULL; sal_Char *pTmpName = NULL;
if (prefix) if (prefix)
@@ -122,34 +122,48 @@ OString makeTempName(sal_Char* prefix)
if ( osl_getEnvironment(uTEMP.pData, &uPattern.pData) != osl_Process_E_None ) if ( osl_getEnvironment(uTEMP.pData, &uPattern.pData) != osl_Process_E_None )
{ {
#if defined(SAL_W32) || defined(SAL_OS2) #if defined(SAL_W32) || defined(SAL_OS2)
strcpy(tmpPattern, "."); OSL_ASSERT( sizeof(tmpPattern) > RTL_CONSTASCII_LENGTH( "." ) );
strncpy(tmpPattern, ".", sizeof(tmpPattern)-1);
#else #else
strcpy(tmpPattern, "/tmp"); OSL_ASSERT( sizeof(tmpPattern) > RTL_CONSTASCII_LENGTH( "/tmp" ) );
strncpy(tmpPattern, "/tmp", sizeof(tmpPattern)-1);
#endif #endif
} }
} }
if (uPattern.getLength()) if (uPattern.getLength())
{ {
strcpy(tmpPattern, OUStringToOString(uPattern, RTL_TEXTENCODING_UTF8).getStr()); OString aOStr( OUStringToOString(uPattern, RTL_TEXTENCODING_UTF8) );
OSL_ASSERT( sizeof(tmpPattern) > aOStr.getLength() );
strncpy(tmpPattern, aOStr.getStr(), sizeof(tmpPattern)-1);
} }
#ifdef SAL_W32 #ifdef SAL_W32
strcat(tmpPattern, "\\"); OSL_ASSERT( sizeof(tmpPattern) > ( strlen(tmpPattern)
strcat(tmpPattern, pPrefix); + RTL_CONSTASCII_LENGTH("\\")
strcat(tmpPattern, "XXXXXX"); + strlen(pPrefix)
+ RTL_CONSTASCII_LENGTH("XXXXXX") ) );
strncat(tmpPattern, "\\", sizeof(tmpPattern)-1-strlen(tmpPattern));
strncat(tmpPattern, pPrefix, sizeof(tmpPattern)-1-strlen(tmpPattern));
strncat(tmpPattern, "XXXXXX", sizeof(tmpPattern)-1-strlen(tmpPattern));
pTmpName = mktemp(tmpPattern); pTmpName = mktemp(tmpPattern);
#endif #endif
#ifdef SAL_OS2 #ifdef SAL_OS2
strcpy(tmpPattern, tempnam(NULL, prefix); char* tmpname = tempnam(NULL, prefix);
OSL_ASSERT( sizeof(tmpPattern) > strlen(tmpname) );
strncpy(tmpPattern, tmpname, sizeof(tmpPattern)-1);
pTmpName = tmpPattern; pTmpName = tmpPattern;
#endif #endif
#ifdef SAL_UNX #ifdef SAL_UNX
strcat(tmpPattern, "/"); OSL_ASSERT( sizeof(tmpPattern) > ( strlen(tmpPattern)
strcat(tmpPattern, pPrefix); + RTL_CONSTASCII_LENGTH("/")
strcat(tmpPattern, "XXXXXX"); + strlen(pPrefix)
+ RTL_CONSTASCII_LENGTH("XXXXXX") ) );
strncat(tmpPattern, "/", sizeof(tmpPattern)-1-strlen(tmpPattern));
strncat(tmpPattern, pPrefix, sizeof(tmpPattern)-1-strlen(tmpPattern));
strncat(tmpPattern, "XXXXXX", sizeof(tmpPattern)-1-strlen(tmpPattern));
#if defined(FREEBSD) || defined(MACOSX) #if defined(FREEBSD) || defined(MACOSX)
pTmpName = mkstemp(tmpPattern); pTmpName = mkstemp(tmpPattern);
#else #else

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: cpputype.cxx,v $ * $RCSfile: cpputype.cxx,v $
* *
* $Revision: 1.20 $ * $Revision: 1.21 $
* *
* last change: $Author: dbo $ $Date: 2002-07-31 12:46:38 $ * last change: $Author: hr $ $Date: 2003-03-19 15:53:41 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -1412,7 +1412,7 @@ void CppuType::dumpConstantValue(FileStream& o, sal_uInt16 index)
case RT_TYPE_BYTE: case RT_TYPE_BYTE:
{ {
char tmp[16]; char tmp[16];
sprintf(tmp, "0x%x", (sal_Int8)constValue.m_value.aByte); snprintf(tmp, sizeof(tmp), "0x%x", (sal_Int8)constValue.m_value.aByte);
o << "(sal_Int8)" << tmp; o << "(sal_Int8)" << tmp;
} }
break; break;
@@ -2024,7 +2024,7 @@ void InterfaceType::dumpCGetCppuType(FileStream& o)
RTUik uik; RTUik uik;
m_reader.getUik(uik); m_reader.getUik(uik);
sal_Char buffer[53]; sal_Char buffer[53];
sprintf(buffer, "0x%.8x, 0x%.4x, 0x%.4x, 0x%.8x, 0x%.8x,\n", snprintf(buffer, sizeof(buffer), "0x%.8x, 0x%.4x, 0x%.4x, 0x%.8x, 0x%.8x,\n",
uik.m_Data1, uik.m_Data2, uik.m_Data3, uik.m_Data4, uik.m_Data5); uik.m_Data1, uik.m_Data2, uik.m_Data3, uik.m_Data4, uik.m_Data5);
o << buffer; o << buffer;

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: cunotype.cxx,v $ * $RCSfile: cunotype.cxx,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: jsc $ $Date: 2002-06-18 17:23:49 $ * last change: $Author: hr $ $Date: 2003-03-19 15:53:42 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -1455,7 +1455,7 @@ void CunoType::dumpConstantValue(FileStream& o, sal_uInt16 index)
case RT_TYPE_BYTE: case RT_TYPE_BYTE:
{ {
char tmp[16]; char tmp[16];
sprintf(tmp, "0x%x", (sal_Int8)constValue.m_value.aByte); snprintf(tmp, sizeof(tmp), "0x%x", (sal_Int8)constValue.m_value.aByte);
o << "(sal_Int8)" << tmp; o << "(sal_Int8)" << tmp;
} }
break; break;
@@ -2060,7 +2060,7 @@ void InterfaceType::dumpCGetCunoType(FileStream& o)
RTUik uik; RTUik uik;
m_reader.getUik(uik); m_reader.getUik(uik);
sal_Char buffer[53]; sal_Char buffer[53];
sprintf(buffer, "0x%.8x, 0x%.4x, 0x%.4x, 0x%.8x, 0x%.8x,\n", snprintf(buffer, sizeof(buffer), "0x%.8x, 0x%.4x, 0x%.4x, 0x%.8x, 0x%.8x,\n",
uik.m_Data1, uik.m_Data2, uik.m_Data3, uik.m_Data4, uik.m_Data5); uik.m_Data1, uik.m_Data2, uik.m_Data3, uik.m_Data4, uik.m_Data5);
o << buffer; o << buffer;

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: idltype.cxx,v $ * $RCSfile: idltype.cxx,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change: $Author: jsc $ $Date: 2002-06-18 17:24:51 $ * last change: $Author: hr $ $Date: 2003-03-19 15:53:45 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -701,7 +701,7 @@ void IdlType::dumpConstantValue(FileStream& o, sal_uInt16 index)
case RT_TYPE_BYTE: case RT_TYPE_BYTE:
{ {
char tmp[16]; char tmp[16];
sprintf(tmp, "0x%x", (sal_Int8)constValue.m_value.aByte); snprintf(tmp, sizeof(tmp), "0x%x", (sal_Int8)constValue.m_value.aByte);
o << tmp; o << tmp;
} }
break; break;

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: javatype.cxx,v $ * $RCSfile: javatype.cxx,v $
* *
* $Revision: 1.16 $ * $Revision: 1.17 $
* *
* last change: $Author: dbo $ $Date: 2002-07-31 12:46:45 $ * last change: $Author: hr $ $Date: 2003-03-19 15:53:45 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -373,11 +373,11 @@ void JavaType::dumpTypeInit(FileStream& o, const OString& name, const OString& t
o << indent() << name << " = \"\";\n"; o << indent() << name << " = \"\";\n";
return; return;
case BT_TYPE: case BT_TYPE:
o << indent() << name << " = new com.sun.star.uno.Type();\n"; o << indent() << name << " = com.sun.star.uno.Type.VOID;\n";
return; return;
case BT_ANY: case BT_ANY:
// o << "new java.lang.Object()"; o << indent() << name << " = com.sun.star.uno.Any.VOID;\n";
// return; return;
case BT_BOOLEAN: case BT_BOOLEAN:
case BT_CHAR: case BT_CHAR:
case BT_FLOAT: case BT_FLOAT:
@@ -865,7 +865,7 @@ sal_Bool InterfaceType::dumpFile(FileStream& o)
RTUik uik; RTUik uik;
m_reader.getUik(uik); m_reader.getUik(uik);
sal_Char buffer[67]; sal_Char buffer[67];
sprintf(buffer, "0x%.8x, (short)0x%.4x, (short)0x%.4x, 0x%.8x, 0x%.8x", snprintf(buffer, sizeof(buffer), "0x%.8x, (short)0x%.4x, (short)0x%.4x, 0x%.8x, 0x%.8x",
uik.m_Data1, uik.m_Data2, uik.m_Data3, uik.m_Data4, uik.m_Data5); uik.m_Data1, uik.m_Data2, uik.m_Data3, uik.m_Data4, uik.m_Data5);
o << buffer << " );\n\n"; o << buffer << " );\n\n";
*/ */