diff options
author | sb <sb@openoffice.org> | 2010-01-08 13:21:39 +0100 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-01-08 13:21:39 +0100 |
commit | 736960b56fdf3a640bfbb48d41833b7f7074295d (patch) | |
tree | 632e70154aa6f79b134de6c01ddc3ee019449a03 | |
parent | 9af3a0f3254ff8e6fe0ed0559a07aadf41a1eb83 (diff) | |
parent | 6e8628fb7374b7d19e15f03e63f8ad221ca25f1e (diff) |
sb111: merged in DEV300_m69
35 files changed, 309 insertions, 911 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx index 1aca0f480b6a..e901a110213f 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx @@ -61,7 +61,9 @@ static typelib_TypeClass cpp2uno_call( sal_Int64 * pRegisterReturn /* space for register return */ ) { int ng = 0; //number of gpr registers used +#ifndef __NO_FPRS__ int nf = 0; //number of fpr regsiters used +#endif void ** pCppStack; //temporary stack pointer // gpreg: [ret *], this, [gpr params] @@ -123,11 +125,23 @@ static typelib_TypeClass cpp2uno_call( { case typelib_TypeClass_DOUBLE: +#ifndef __NO_FPRS__ if (nf < 8) { pCppArgs[nPos] = fpreg; pUnoArgs[nPos] = fpreg; nf++; fpreg += 2; +#else + if (ng & 1) { + ng++; + gpreg++; + } + if (ng < 8) { + pCppArgs[nPos] = gpreg; + pUnoArgs[nPos] = gpreg; + ng += 2; + gpreg += 2; +#endif } else { if (((long)ovrflw) & 4) ovrflw++; pCppArgs[nPos] = ovrflw; @@ -139,6 +153,7 @@ static typelib_TypeClass cpp2uno_call( case typelib_TypeClass_FLOAT: // fpreg are all double values so need to // modify fpreg to be a single word float value +#ifndef __NO_FPRS__ if (nf < 8) { float tmp = (float) (*((double *)fpreg)); (*((float *) fpreg)) = tmp; @@ -146,6 +161,13 @@ static typelib_TypeClass cpp2uno_call( pUnoArgs[nPos] = fpreg; nf++; fpreg += 2; +#else + if (ng < 8) { + pCppArgs[nPos] = gpreg; + pUnoArgs[nPos] = gpreg; + ng++; + gpreg++; +#endif } else { #if 0 /* abi is not being followed correctly */ if (((long)ovrflw) & 4) ovrflw++; @@ -164,11 +186,11 @@ static typelib_TypeClass cpp2uno_call( case typelib_TypeClass_HYPER: case typelib_TypeClass_UNSIGNED_HYPER: - if (ng < 7) { - if (ng & 1) { - ng++; - gpreg++; - } + if (ng & 1) { + ng++; + gpreg++; + } + if (ng < 8) { pCppArgs[nPos] = gpreg; pUnoArgs[nPos] = gpreg; ng += 2; @@ -488,10 +510,12 @@ static typelib_TypeClass cpp_mediate( static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpregptr, void** fpregptr, void** ovrflw) { sal_Int32 gpreg[8]; - double fpreg[8]; - memcpy( gpreg, gpregptr, 32); + +#ifndef __NO_FPRS__ + double fpreg[8]; memcpy( fpreg, fpregptr, 64); +#endif volatile long nRegReturn[2]; @@ -499,10 +523,14 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg // fprintf(stderr,"in cpp_vtable_call nVtableOffset is %x\n",nVtableOffset); // fflush(stderr); - sal_Bool bComplex = nFunctionIndex & 0x80000000 ? sal_True : sal_False; - typelib_TypeClass aType = - cpp_mediate( nFunctionIndex, nVtableOffset, (void**)gpreg, (void**)fpreg, ovrflw, (sal_Int64*)nRegReturn ); + cpp_mediate( nFunctionIndex, nVtableOffset, (void**)gpreg, +#ifndef __NO_FPRS__ + (void**)fpreg, +#else + NULL, +#endif + ovrflw, (sal_Int64*)nRegReturn ); switch( aType ) { @@ -524,13 +552,25 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg break; case typelib_TypeClass_FLOAT: +#ifndef __NO_FPRS__ __asm__( "lfs 1,%0\n\t" : : "m" (*((float*)nRegReturn)) ); + #else + __asm__( "lwz 3,%0\n\t" : : + "m"(nRegReturn[0]) ); +#endif break; case typelib_TypeClass_DOUBLE: +#ifndef __NO_FPRS__ __asm__( "lfd 1,%0\n\t" : : "m" (*((double*)nRegReturn)) ); +#else + __asm__( "lwz 3,%0\n\t" : : + "m"(nRegReturn[0]) ); + __asm__( "lwz 4,%0\n\t" : : + "m"(nRegReturn[1]) ); +#endif break; case typelib_TypeClass_HYPER: @@ -577,6 +617,7 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal // # next save fpr 1 to fpr 8 (aligned to 8) + // if dedicated floating point registers are used // stfd f1,-2016(r1) // stfd f2,-2008(r1) // stfd f3,-2000(r1) @@ -604,6 +645,10 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal // #now load up the pointer to the saved fpr registers // addi r6,r1,-2016 + // if no dedicated floating point registers are used than we have NULL + // pointer there + // li r6, 0 + // // #now load up the pointer to the overflow call stack // addi r7,r1,8 @@ -617,6 +662,7 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal * p++ = 0x9101f814; * p++ = 0x9121f818; * p++ = 0x9141f81c; +#ifndef __NO_FPRS__ * p++ = 0xd821f820; * p++ = 0xd841f828; * p++ = 0xd861f830; @@ -625,6 +671,17 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal * p++ = 0xd8c1f848; * p++ = 0xd8e1f850; * p++ = 0xd901f858; +#else + /* these nops could be replaced with a smaller codeSnippetSize - 8 * 4 */ + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; + * p++ = 0x60000000; +#endif * p++ = 0x3c600000 | (((unsigned long)cpp_vtable_call) >> 16); * p++ = 0x60630000 | (((unsigned long)cpp_vtable_call) & 0x0000FFFF); * p++ = 0x7c6903a6; @@ -633,7 +690,11 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal * p++ = 0x3c800000 | (((unsigned long)vtableOffset) >> 16); * p++ = 0x60840000 | (((unsigned long)vtableOffset) & 0x0000FFFF); * p++ = 0x38a1f800; +#ifndef __NO_FPRS__ * p++ = 0x38c1f820; +#else + * p++ = 0x38c00000; +#endif * p++ = 0x38e10008; * p++ = 0x4e800420; return (code + codeSnippetSize); diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx index 28ad7dc83ed7..adb10dae24c7 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx @@ -137,8 +137,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; MutexGuard guard( m_mutex ); - t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); - if (iFind == m_rttis.end()) + t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); + if (iRttiFind == m_rttis.end()) { // RTTI symbol OStringBuffer buf( 64 ); @@ -202,7 +202,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR } else { - rtti = iFind->second; + rtti = iRttiFind->second; } return rtti; diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx index 2a8626733f24..8c527df2d48c 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx @@ -74,12 +74,14 @@ static void callVirtualMethod( void (*ptr)(); int gpr[8]; // storage for gpregisters, map to r3-r10 int off; // offset used to find function +#ifndef __NO_FPRS__ double fpr[8]; // storage for fpregisters, map to f1-f8 - int n; // number of gprs mapped so far int f; // number of fprs mapped so far + double dret; // temporary function return values +#endif + int n; // number of gprs mapped so far long *p; // pointer to parameter overflow area int c; // character of parameter type being decoded - double dret; // temporary function return values int iret, iret2; // Because of the Power PC calling conventions we could be passing @@ -93,7 +95,7 @@ static void callVirtualMethod( // Note: could require up to 2*nStackLongs words of parameter stack area // if the call has many float parameters (i.e. floats take up only 1 - // word on the stack but take 2 words in parameter area in the + // word on the stack but double takes 2 words in parameter area in the // stack frame . // Update! floats on the outgoing parameter stack only take up 1 word @@ -119,7 +121,9 @@ static void callVirtualMethod( // now begin to load the C++ function arguments into storage n = 0; +#ifndef __NO_FPRS__ f = 0; +#endif // now we need to parse the entire signature string */ // until we get the END indicator */ @@ -143,8 +147,16 @@ static void callVirtualMethod( c = *pPT; switch (c) { case 'D': /* type is double */ +#ifndef __NO_FPRS__ if (f < 8) { fpr[f++] = *((double *)pStackLongs); /* store in register */ +#else + if (n & 1) + n++; + if (n < 8) { + gpr[n++] = *pStackLongs; + gpr[n++] = *(pStackLongs+1); +#endif } else { if (((long) p) & 4) p++; @@ -163,8 +175,13 @@ static void callVirtualMethod( store floats as a *single* word on outgoing parameter stack to match what gcc actually does */ +#ifndef __NO_FPRS__ if (f < 8) { fpr[f++] = *((float *)pStackLongs); +#else + if (n < 8) { + gpr[n++] = *pStackLongs; +#endif } else { #if 0 /* if abi were followed */ if (((long) p) & 4) @@ -243,6 +260,7 @@ static void callVirtualMethod( "lwz 8, 20(%0)\n\t" "lwz 9, 24(%0)\n\t" "lwz 10, 28(%0)\n\t" +#ifndef __NO_FPRS__ "lfd 1, 0(%1)\n\t" "lfd 2, 8(%1)\n\t" "lfd 3, 16(%1)\n\t" @@ -252,16 +270,24 @@ static void callVirtualMethod( "lfd 7, 48(%1)\n\t" "lfd 8, 56(%1)\n\t" : : "r" (gpr), "r" (fpr) +#else + : : "r" (gpr) +#endif : "0", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ); (*ptr)(); __asm__ __volatile__ ( - "mr %1, 3\n\t" - "mr %2, 4\n\t" - "fmr %0, 1\n\t" - : "=f" (dret), "=r" (iret), "=r" (iret2) : ); + "mr %0, 3\n\t" + "mr %1, 4\n\t" +#ifndef __NO_FPRS__ + "fmr %2, 1\n\t" + : "=r" (iret), "=r" (iret2), "=f" (dret) +#else + : "=r" (iret), "=r" (iret2) +#endif + : ); switch( eReturnType ) { @@ -284,10 +310,21 @@ static void callVirtualMethod( *(unsigned char*)pRegisterReturn = (unsigned char)iret; break; case typelib_TypeClass_FLOAT: +#ifndef __NO_FPRS__ *(float*)pRegisterReturn = (float)dret; +#else + ((unsigned int*)pRegisterReturn)[0] = iret; +#endif break; case typelib_TypeClass_DOUBLE: +#ifndef __NO_FPRS__ *(double*)pRegisterReturn = dret; +#else + ((unsigned int*)pRegisterReturn)[0] = iret; + ((unsigned int*)pRegisterReturn)[1] = iret2; +#endif + break; + default: break; } } @@ -399,6 +436,8 @@ static void cpp_call( case typelib_TypeClass_UNSIGNED_HYPER: *pPT++ = 'H'; pCppStack += sizeof(sal_Int32); // extra long + default: + break; } // no longer needed @@ -518,7 +557,6 @@ void unoInterfaceProxyDispatch( // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); - typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; switch (pMemberDescr->eTypeClass) { diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx index c1e938446e77..fc5a9af1ac5c 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx @@ -121,16 +121,14 @@ static typelib_TypeClass cpp2uno_call( for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; - typelib_TypeDescription * pParamTypeDescr = 0; - TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); int nUsedGPR = 0; int nUsedSSE = 0; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 bool bFitsRegisters = #endif x86_64::examine_argument( rParam.pTypeRef, false, nUsedGPR, nUsedSSE ); - if ( !rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ) ) // value + if ( !rParam.bOut && bridges::cpp_uno::shared::isSimpleType( rParam.pTypeRef ) ) // value { // Simple types must fit exactly one register on x86_64 OSL_ASSERT( bFitsRegisters && ( ( nUsedSSE == 1 && nUsedGPR == 0 ) || ( nUsedSSE == 0 && nUsedGPR == 1 ) ) ); @@ -155,12 +153,12 @@ static typelib_TypeClass cpp2uno_call( else pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw++; } - - // no longer needed - TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } else // struct <= 16 bytes || ptr to complex value || ref { + typelib_TypeDescription * pParamTypeDescr = 0; + TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); + void *pCppStack; if ( nr_gpr < x86_64::MAX_GPR_REGS ) { diff --git a/bridges/source/remote/urp/urp_reader.cxx b/bridges/source/remote/urp/urp_reader.cxx index dd9ff0af80ec..f2ac4f3e9dc7 100644 --- a/bridges/source/remote/urp/urp_reader.cxx +++ b/bridges/source/remote/urp/urp_reader.cxx @@ -372,8 +372,8 @@ inline sal_Bool OReaderThread::readFlags( struct MessageFlags *pFlags ) } pFlags->bSynchronous = ( HDRFLAG_SYNCHRONOUS & moreFlags ); pFlags->bMustReply = ( HDRFLAG_MUSTREPLY & moreFlags ); - OSL_ENSURE( pFlags->bSynchronous && pFlags->bMustReply || - ! pFlags->bSynchronous && !pFlags->bMustReply, + OSL_ENSURE( (pFlags->bSynchronous && pFlags->bMustReply) || + (!pFlags->bSynchronous && !pFlags->bMustReply), "urp-bridge : customized calls currently not supported !"); } diff --git a/cpputools/source/sp2bv/makefile.mk b/cpputools/source/sp2bv/makefile.mk index 2b80d6e431c6..e9ca09bff6df 100644 --- a/cpputools/source/sp2bv/makefile.mk +++ b/cpputools/source/sp2bv/makefile.mk @@ -34,7 +34,7 @@ PRJ=..$/.. PRJNAME=cpputools TARGET=sp2bv TARGETTYPE=CUI -.IF "$(OS)"!="IRIX" && "$(OS)" != "MACOSX" +.IF "$(OS)" != "MACOSX" # hack to get stdc++ linked NO_DEFAULT_STL=TRUE .ENDIF diff --git a/jurt/com/sun/star/lib/uno/environments/java/java_environment.java b/jurt/com/sun/star/lib/uno/environments/java/java_environment.java index 36404f28d57e..aa9a21a26b22 100644 --- a/jurt/com/sun/star/lib/uno/environments/java/java_environment.java +++ b/jurt/com/sun/star/lib/uno/environments/java/java_environment.java @@ -37,7 +37,6 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.HashMap; import java.util.Iterator; -import java.util.LinkedList; /** * The java_environment is the environment where objects and @@ -159,70 +158,64 @@ public final class java_environment implements IEnvironment { } private static final class Registry { - public Object register(Object object, String oid, Type type) { - synchronized (map) { - cleanUp(); - Level1Entry l1 = getLevel1Entry(oid); - if (l1 != null) { - Level2Entry l2 = l1.get(type); - if (l2 != null) { - Object o = l2.get(); - if (o != null) { - l2.acquire(); - return o; - } + public synchronized Object register( + Object object, String oid, Type type) + { + cleanUp(); + Level1Entry l1 = level1map.get(oid); + if (l1 != null) { + Level2Entry l2 = l1.level2map.get(type); + if (l2 != null) { + Object o = l2.get(); + if (o != null) { + l2.acquire(); + return o; } } - // TODO If a holder references an unreachable object, but still - // has a positive count, it is replaced with a new holder - // (referencing a reachable object, and with a count of 1). Any - // later calls to revoke that should decrement the count of the - // previous holder would now decrement the count of the new - // holder, removing it prematurely. This is a design flaw that - // will be fixed when IEnvironment.revokeInterface is changed to - // no longer use counting. (And this problem is harmless, as - // currently a holder either references a strongly held object - // and uses register/revoke to control it, or references a - // weakly held proxy and never revokes it.) - if (l1 == null) { - l1 = new Level1Entry(); - map.put(oid, l1); - } - l1.add(new Level2Entry(oid, type, object, queue)); } + // TODO If a holder references an unreachable object, but still has + // a positive count, it is replaced with a new holder (referencing a + // reachable object, and with a count of 1). Any later calls to + // revoke that should decrement the count of the previous holder + // would now decrement the count of the new holder, removing it + // prematurely. This is a design flaw that will be fixed when + // IEnvironment.revokeInterface is changed to no longer use + // counting. (And this problem is harmless, as currently a holder + // either references a strongly held object and uses register/revoke + // to control it, or references a weakly held proxy and never + // revokes it.) + if (l1 == null) { + l1 = new Level1Entry(); + level1map.put(oid, l1); + } + l1.level2map.put(type, new Level2Entry(oid, type, object, queue)); return object; } - public boolean revoke(String oid, Type type) { - synchronized (map) { - Level1Entry l1 = getLevel1Entry(oid); - Level2Entry l2 = null; - if (l1 != null) { - l2 = l1.get(type); - if (l2 != null && l2.release()) { - removeLevel2Entry(oid, l1, l2); - } + public synchronized boolean revoke(String oid, Type type) { + Level1Entry l1 = level1map.get(oid); + Level2Entry l2 = null; + if (l1 != null) { + l2 = l1.level2map.get(type); + if (l2 != null && l2.release()) { + removeLevel2Entry(l1, oid, type); } - cleanUp(); - return l2 != null; } + cleanUp(); + return l2 != null; } - public Object get(String oid, Type type) { - synchronized (map) { - Level1Entry l1 = getLevel1Entry(oid); - return l1 == null ? null : l1.find(type); - } + public synchronized Object get(String oid, Type type) { + Level1Entry l1 = level1map.get(oid); + return l1 == null ? null : l1.find(type); } - public void clear() { - synchronized (map) { - map.clear(); - cleanUp(); - } + public synchronized void clear() { + level1map.clear(); + cleanUp(); } - // must only be called while synchronized on map: + // must only be called while synchronized on this Registry: private void cleanUp() { for (;;) { Level2Entry l2 = (Level2Entry) queue.poll(); @@ -235,55 +228,38 @@ public final class java_environment implements IEnvironment { // created since now e1.get() == null), and only then e1 is // enqueued. To not erroneously remove the new e2 in that case, // check whether the map still contains e1: - String oid = l2.getOid(); - Level1Entry l1 = getLevel1Entry(oid); - if (l1 != null && l1.get(l2.getType()) == l2) { - removeLevel2Entry(oid, l1, l2); + Level1Entry l1 = level1map.get(l2.oid); + if (l1 != null && l1.level2map.get(l2.type) == l2) { + removeLevel2Entry(l1, l2.oid, l2.type); } } } - // must only be called while synchronized on map: - private Level1Entry getLevel1Entry(String oid) { - return (Level1Entry) map.get(oid); - } - - // must only be called while synchronized on map: - private void removeLevel2Entry(String oid, Level1Entry l1, - Level2Entry l2) { - if (l1.remove(l2)) { - map.remove(oid); + // must only be called while synchronized on this Registry: + private void removeLevel2Entry(Level1Entry l1, String oid, Type type) { + l1.level2map.remove(type); + if (l1.level2map.isEmpty()) { + level1map.remove(oid); } } private static final class Level1Entry { - // must only be called while synchronized on map: - public Level2Entry get(Type type) { - for (Iterator i = list.iterator(); i.hasNext();) { - Level2Entry l2 = (Level2Entry) i.next(); - if (l2.getType().equals(type)) { - return l2; - } - } - return null; - } - - // must only be called while synchronized on map: + // must only be called while synchronized on enclosing Registry: public Object find(Type type) { // First, look for an exactly matching entry; then, look for an // arbitrary entry for a subtype of the request type: - for (Iterator i = list.iterator(); i.hasNext();) { - Level2Entry l2 = (Level2Entry) i.next(); - if (l2.getType().equals(type)) { - Object o = l2.get(); - if (o != null) { - return o; - } + Level2Entry l2 = level2map.get(type); + if (l2 != null) { + Object o = l2.get(); + if (o != null) { + return o; } } - for (Iterator i = list.iterator(); i.hasNext();) { - Level2Entry l2 = (Level2Entry) i.next(); - if (type.isSupertypeOf(l2.getType())) { + for (Iterator<Level2Entry> i = level2map.values().iterator(); + i.hasNext();) + { + l2 = i.next(); + if (type.isSupertypeOf(l2.type)) { Object o = l2.get(); if (o != null) { return o; @@ -293,53 +269,37 @@ public final class java_environment implements IEnvironment { return null; } - // must only be called while synchronized on map: - public void add(Level2Entry l2) { - list.add(l2); - } - - // must only be called while synchronized on map: - public boolean remove(Level2Entry l2) { - list.remove(l2); - return list.isEmpty(); - } - - private final LinkedList list = new LinkedList(); // of Level2Entry + public final HashMap<Type, Level2Entry> level2map = + new HashMap<Type, Level2Entry>(); } - private static final class Level2Entry extends WeakReference { - public Level2Entry(String oid, Type type, Object object, - ReferenceQueue queue) { + private static final class Level2Entry extends WeakReference<Object> { + public Level2Entry( + String oid, Type type, Object object, ReferenceQueue queue) + { super(object, queue); this.oid = oid; this.type = type; } - public String getOid() { - return oid; - } - - public Type getType() { - return type; - } - - // must only be called while synchronized on map: + // must only be called while synchronized on enclosing Registry: public void acquire() { ++count; } - // must only be called while synchronized on map: + // must only be called while synchronized on enclosing Registry: public boolean release() { return --count == 0; } - private final String oid; - private final Type type; + public final String oid; + public final Type type; + private int count = 1; } - private final HashMap map = new HashMap(); - // from OID (String) to Level1Entry + private final HashMap<String, Level1Entry> level1map = + new HashMap<String, Level1Entry>(); private final ReferenceQueue queue = new ReferenceQueue(); } diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/makefile.mk b/jvmfwk/plugins/sunmajor/javaenvsetup/makefile.mk index 29aa95854d33..55fb0e2d3c0d 100755 --- a/jvmfwk/plugins/sunmajor/javaenvsetup/makefile.mk +++ b/jvmfwk/plugins/sunmajor/javaenvsetup/makefile.mk @@ -34,9 +34,7 @@ PRJ=..$/..$/.. PRJNAME=javaldx TARGET=javaldx TARGETTYPE=CUI -.IF "$(OS)"!="IRIX" NO_DEFAULT_STL=TRUE -.ENDIF LIBTARGET=NO ENABLE_EXCEPTIONS=true diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx index 56972ea0e66f..e7f55eb91595 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx @@ -54,13 +54,6 @@ public: } test; #endif -SunVersion::SunVersion(): m_nUpdateSpecial(0), - m_preRelease(Rel_NONE), - m_bValid(false) -{ - memset(m_arVersionParts, 0, sizeof(m_arVersionParts)); -} - SunVersion::SunVersion(const rtl::OUString &usVer): m_nUpdateSpecial(0), m_preRelease(Rel_NONE), usVersion(usVer) diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx index f6114672b17c..51b4ecf10221 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx @@ -92,7 +92,6 @@ protected: PreRelease m_preRelease; public: - SunVersion(); SunVersion(const char * szVer); SunVersion(const rtl::OUString& usVer); ~SunVersion(); diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 61edd8ebcaf4..319424038d34 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -300,13 +300,14 @@ class AsynchReader: public Thread public: AsynchReader(oslFileHandle & rHandle); - +#if OSL_DEBUG_LEVEL >= 2 /** only call this function after this thread has finished. That is, call join on this instance and then call getData. */ OString getData(); +#endif }; AsynchReader::AsynchReader(oslFileHandle & rHandle): @@ -314,11 +315,13 @@ AsynchReader::AsynchReader(oslFileHandle & rHandle): { } +#if OSL_DEBUG_LEVEL >= 2 OString AsynchReader::getData() { OSL_ASSERT(isRunning() == sal_False ); return OString(m_arData.get(), m_nDataSize); } +#endif void AsynchReader::run() { diff --git a/sal/inc/osl/endian.h b/sal/inc/osl/endian.h index b0d2922839be..09529a48840f 100644 --- a/sal/inc/osl/endian.h +++ b/sal/inc/osl/endian.h @@ -118,20 +118,6 @@ extern "C" { # include <machine/param.h> #endif -#ifdef IRIX -# include <sys/endian.h> -# if BYTE_ORDER == LITTLE_ENDIAN -# undef _BIG_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == BIG_ENDIAN -# undef _LITTLE_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == PDP_ENDIAN -# undef _LITTLE_ENDIAN -# undef _BIG_ENDIAN -# endif -#endif - #ifdef _WIN16 # define _LITTLE_ENDIAN #endif @@ -166,8 +152,7 @@ extern "C" { #if !defined(_WIN32) && !defined(_WIN16) && !defined(OS2) && \ !defined(LINUX) && !defined(NETBSD) && !defined(SCO) && \ !defined(AIX) && !defined(HPUX) && \ - !defined(SOLARIS) && !defined(IRIX) && \ - !defined(MACOSX) && !defined(FREEBSD) + !defined(SOLARIS) && !defined(MACOSX) && !defined(FREEBSD) # error "Target platform not specified !" #endif diff --git a/sal/inc/osl/thread.hxx b/sal/inc/osl/thread.hxx index 0df24e07587a..b770120c167e 100644 --- a/sal/inc/osl/thread.hxx +++ b/sal/inc/osl/thread.hxx @@ -117,7 +117,7 @@ public: osl_joinWithThread(m_hThread); } - sal_Bool SAL_CALL isRunning() + sal_Bool SAL_CALL isRunning() const { return osl_isThreadRunning(m_hThread); } @@ -128,7 +128,7 @@ public: osl_setThreadPriority(m_hThread, Priority); } - oslThreadPriority SAL_CALL getPriority() + oslThreadPriority SAL_CALL getPriority() const { return m_hThread ? osl_getThreadPriority(m_hThread) : osl_Thread_PriorityUnknown; } diff --git a/sal/inc/rtl/math.hxx b/sal/inc/rtl/math.hxx index 5760340cc6a4..4891b7565647 100644 --- a/sal/inc/rtl/math.hxx +++ b/sal/inc/rtl/math.hxx @@ -357,17 +357,28 @@ inline bool isSignBitSet(double d) */ inline void setInf(double * pd, bool bNegative) { - reinterpret_cast< sal_math_Double * >(pd)->w32_parts.msw - = bNegative ? 0xFFF00000 : 0x7FF00000; - reinterpret_cast< sal_math_Double * >(pd)->w32_parts.lsw = 0; + union + { + double sd; + sal_math_Double md; + }; + md.w32_parts.msw = bNegative ? 0xFFF00000 : 0x7FF00000; + md.w32_parts.lsw = 0; + *pd = sd; } /** Set a QNAN. */ inline void setNan(double * pd) { - reinterpret_cast< sal_math_Double * >(pd)->w32_parts.msw = 0x7FFFFFFF; - reinterpret_cast< sal_math_Double * >(pd)->w32_parts.lsw = 0xFFFFFFFF; + union + { + double sd; + sal_math_Double md; + }; + md.w32_parts.msw = 0x7FFFFFFF; + md.w32_parts.lsw = 0xFFFFFFFF; + *pd = sd; } /** If a value is a valid argument for sin(), cos(), tan(). diff --git a/sal/inc/rtl/uuid.h b/sal/inc/rtl/uuid.h index 6451ac7738d6..76911dd841fb 100644 --- a/sal/inc/rtl/uuid.h +++ b/sal/inc/rtl/uuid.h @@ -201,8 +201,6 @@ void SAL_CALL rtl_createNamedUuid( #define UUID_SYSTEM_TIME_RESOLUTION_100NS_TICKS 10 #elif MACOSX #define UUID_SYSTEM_TIME_RESOLUTION_100NS_TICKS 100000 -#elif IRIX -#define UUID_SYSTEM_TIME_RESOLUTION_100NS_TICKS 10 #else #error "System time resolution must be calculated!" #endif diff --git a/sal/inc/sal/alloca.h b/sal/inc/sal/alloca.h index 703027277f18..912e58eff06e 100644 --- a/sal/inc/sal/alloca.h +++ b/sal/inc/sal/alloca.h @@ -31,7 +31,7 @@ #ifndef INCLUDED_SAL_ALLOCA_H #define INCLUDED_SAL_ALLOCA_H -#if defined (SOLARIS) || defined (LINUX) || defined (IRIX) || defined(__EMX__) +#if defined (SOLARIS) || defined (LINUX) || defined(__EMX__) #ifndef INCLUDED_ALLOCA_H #include <alloca.h> diff --git a/sal/inc/sal/config.h b/sal/inc/sal/config.h index f16165fe72cb..c9d31a437758 100644 --- a/sal/inc/sal/config.h +++ b/sal/inc/sal/config.h @@ -102,7 +102,7 @@ extern "C" { #define SAL_SYSCONFIGFILE( name ) name ".ini" #endif -#if defined(SOLARIS) || defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || defined(SCO) || defined(IRIX) +#if defined(SOLARIS) || defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || defined(SCO) #define SAL_UNX #define SAL_DLLEXTENSION ".so" #define SAL_DLLPREFIX "lib" diff --git a/sal/osl/os2/file.cxx b/sal/osl/os2/file.cxx index e89ce6450bee..f3c1ad015de0 100644 --- a/sal/osl/os2/file.cxx +++ b/sal/osl/os2/file.cxx @@ -2343,7 +2343,7 @@ oslFileError SAL_CALL osl_syncFile(oslFileHandle Handle) # define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) ((__OSL_MSDOS_SUPER_MAGIC != (a).f_type)) #endif /* LINUX */ -#if defined(SOLARIS) || defined(IRIX) +#if defined(SOLARIS) # define __OSL_STATFS_STRUCT struct statvfs # define __OSL_STATFS(dir, sfs) statvfs((dir), (sfs)) # define __OSL_STATFS_BLKSIZ(a) ((sal_uInt64)((a).f_frsize)) @@ -2355,7 +2355,7 @@ oslFileError SAL_CALL osl_syncFile(oslFileHandle Handle) of the target platforms fix it!!!! */ # define __OSL_STATFS_IS_CASE_SENSITIVE_FS(a) (1) # define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) (1) -#endif /* SOLARIS || IRIX*/ +#endif /* SOLARIS */ # define __OSL_STATFS_INIT(a) (memset(&(a), 0, sizeof(__OSL_STATFS_STRUCT))) diff --git a/sal/osl/os2/nlsupport.c b/sal/osl/os2/nlsupport.c index 0efccaa787e6..b05332bab0ea 100644 --- a/sal/osl/os2/nlsupport.c +++ b/sal/osl/os2/nlsupport.c @@ -411,9 +411,6 @@ void _imp_getProcessLocale( rtl_Locale ** ppLocale ) int _imp_setProcessLocale( rtl_Locale * pLocale ) { -#ifdef IRIX - char env_buf[80]; -#endif char locale_buf[64]; /* convert rtl_Locale to locale string */ @@ -421,11 +418,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) { /* only change env vars that exist already */ if( getenv( "LC_ALL" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LC_ALL=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) setenv( "LC_ALL", locale_buf, 1); #else setenv( "LC_ALL", locale_buf ); @@ -433,11 +426,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) } if( getenv( "LC_CTYPE" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LC_CTYPE=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) setenv("LC_CTYPE", locale_buf, 1 ); #else setenv( "LC_CTYPE", locale_buf ); @@ -445,11 +434,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) } if( getenv( "LANG" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LANG=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) || defined( __EMX__ ) setenv("LC_CTYPE", locale_buf, 1 ); #else setenv( "LANG", locale_buf ); diff --git a/sal/osl/os2/socket.c b/sal/osl/os2/socket.c index de70e5b8885a..1c6603b55932 100644 --- a/sal/osl/os2/socket.c +++ b/sal/osl/os2/socket.c @@ -48,7 +48,7 @@ #undef HAVE_POLL_H #endif -#if defined(LINUX) || defined (IRIX) || defined(NETBSD) || defined ( FREEBSD ) || defined (MACOSX) +#if defined(LINUX) || defined(NETBSD) || defined ( FREEBSD ) || defined (MACOSX) #include <sys/poll.h> #define HAVE_POLL_H #endif /* HAVE_POLL_H */ diff --git a/sal/osl/os2/system.h b/sal/osl/os2/system.h index 565dfe3ea9c6..ef7626e9c036 100644 --- a/sal/osl/os2/system.h +++ b/sal/osl/os2/system.h @@ -306,36 +306,6 @@ extern unsigned int nanosleep(unsigned int); # define PTHREAD_SIGACTION cma_sigaction #endif -#ifdef IRIX -# define AF_IPX -1 -# include <pthread.h> -# include <semaphore.h> -# include <sched.h> -# include <sys/socket.h> -# include <sys/un.h> -# include <sys/stropts.h> -# include <netinet/tcp.h> -# include <procfs/procfs.h> -# include <sys/endian.h> -# if BYTE_ORDER == LITTLE_ENDIAN -# undef _BIG_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == BIG_ENDIAN -# undef _LITTLE_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == PDP_ENDIAN -# undef _LITTLE_ENDIAN -# undef _BIG_ENDIAN -# endif -# define SA_FAMILY_DECL \ - union { struct { short sa_family2; } sa_generic; } sa_union -# define PTR_SIZE_T(s) ((int *)&(s)) -# define NO_PTHREAD_PRIORITY -# include <dlfcn.h> -# define IOCHANNEL_TRANSFER_BSD -extern char *strdup(const char *); -#endif - #ifdef SOLARIS # include <shadow.h> # include <sys/procfs.h> @@ -389,7 +359,7 @@ char *macxp_tempnam( const char *tmpdir, const char *prefix ); #if !defined(_WIN32) && !defined(_WIN16) && !defined(OS2) && \ !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) && !defined(SCO) && \ !defined(AIX) && !defined(HPUX) && \ - !defined(SOLARIS) && !defined(IRIX) && !defined(MAC) && \ + !defined(SOLARIS) && !defined(MAC) && \ !defined(MACOSX) # error "Target plattform not specified !" #endif diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c index 437d31157049..886da0c3bee5 100755 --- a/sal/osl/unx/backtrace.c +++ b/sal/osl/unx/backtrace.c @@ -207,54 +207,6 @@ void backtrace_symbols_fd( void **buffer, int size, int fd ) } #endif /* defined FREEBSD */ -#if defined(IRIX) -#include <stdio.h> -#include <rld_interface.h> -#include <exception.h> -#include <sys/signal.h> -#include <unistd.h> - -/* Need extra libs -lexc -ldwarf -lelf */ - -int backtrace( void **buffer, int max_frames ) -{ - struct sigcontext context; - int i = 0; - - memset(&context, 0, sizeof(struct sigcontext)); - - exc_setjmp(&context); - while(context.sc_pc != 1 && i < max_frames) { - exc_unwind(&context, 0); - if(context.sc_pc != 1) { - *(buffer++) = (void *)context.sc_pc; - i++; - } - } - return(i); -} - -void backtrace_symbols_fd( void **buffer, int size, int fd ) -{ - FILE *fp = fdopen( fd, "w" ); - struct sigcontext context; - char *name; - - if ( fp ) { - while(context.sc_pc!=1) { - if(context.sc_pc != 1) { - exc_unwind_name(&context, 0, &name); - fprintf(fp, " 0x%012lx %.100s\n", context.sc_pc, name ? name : "<unknown function>"); - free(name); - } - } - - fflush( fp ); - fclose( fp ); - } -} -#endif /* defined IRIX */ - #ifdef LINUX #ifndef _GNU_SOURCE diff --git a/sal/osl/unx/file_volume.cxx b/sal/osl/unx/file_volume.cxx index a3b7109123b7..4489368a4c9b 100644 --- a/sal/osl/unx/file_volume.cxx +++ b/sal/osl/unx/file_volume.cxx @@ -76,16 +76,6 @@ static const sal_Char* MOUNTTAB="/etc/mtab"; * This information is stored only in the kernel. */ /* static const sal_Char* MOUNTTAB="/etc/mtab"; */ -#elif defined(IRIX) - -#include <mntent.h> -#include <sys/mount.h> -#include <sys/statvfs.h> -#define HAVE_STATFS_H -#include <sys/quota.h> -//#include <ctype.h> -static const sal_Char* MOUNTTAB="/etc/mtab"; - #elif defined(MACOSX) #include <ufs/ufs/quota.h> @@ -140,12 +130,6 @@ static sal_Bool osl_isFloppyMounted(oslVolumeDeviceHandleImpl* pDevice); static sal_Bool osl_getFloppyMountEntry(const sal_Char* pszPath, oslVolumeDeviceHandleImpl* pItem); #endif /* LINUX */ - -#if defined(IRIX) -static sal_Bool osl_isFloppyMounted(oslVolumeDeviceHandleImpl* pDevice); -static sal_Bool osl_getFloppyMountEntry(const sal_Char* pszPath, oslVolumeDeviceHandleImpl* pItem); -#endif /* IRIX */ - #ifdef DEBUG_OSL_FILE static void osl_printFloppyHandle(oslVolumeDeviceHandleImpl* hFloppy); #endif /* DEBUG_OSL_FILE */ @@ -220,7 +204,7 @@ oslFileError osl_getVolumeInformation( rtl_uString* ustrDirectoryURL, oslVolumeI # define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) ((__OSL_MSDOS_SUPER_MAGIC != (a).f_type)) #endif /* LINUX */ -#if defined(SOLARIS) || defined(IRIX) +#if defined(SOLARIS) # define __OSL_STATFS_STRUCT struct statvfs # define __OSL_STATFS(dir, sfs) statvfs((dir), (sfs)) # define __OSL_STATFS_BLKSIZ(a) ((sal_uInt64)((a).f_frsize)) @@ -232,7 +216,7 @@ oslFileError osl_getVolumeInformation( rtl_uString* ustrDirectoryURL, oslVolumeI of the target platforms fix it!!!! */ # define __OSL_STATFS_IS_CASE_SENSITIVE_FS(a) (1) # define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) (1) -#endif /* SOLARIS || IRIX*/ +#endif /* SOLARIS */ # define __OSL_STATFS_INIT(a) (memset(&(a), 0, sizeof(__OSL_STATFS_STRUCT))) @@ -1093,411 +1077,6 @@ osl_isFloppyMounted (oslVolumeDeviceHandleImpl* pDevice) } #endif /* LINUX */ -/****************************************************************************** - * - * IRIX FLOPPY FUNCTIONS - * - *****************************************************************************/ - -#if defined(IRIX) -static oslVolumeDeviceHandle osl_isFloppyDrive(const sal_Char* pszPath) -{ - oslVolumeDeviceHandleImpl* pItem = osl_newVolumeDeviceHandleImpl (); - sal_Bool bRet = sal_False; - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"In osl_isFloppyDrive\n"); -#endif - - bRet=osl_getFloppyMountEntry(pszPath,pItem); - - if ( bRet == sal_False ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_isFloppyDrive [not a floppy]\n"); -#endif - rtl_freeMemory(pItem); - return 0; - } - - -#ifdef DEBUG_OSL_FILE - osl_printFloppyHandle(pItem); -#endif -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_isFloppyDrive [ok]\n"); -#endif - - return (oslVolumeDeviceHandle) pItem; -} - - -static oslFileError osl_mountFloppy(oslVolumeDeviceHandle hFloppy) -{ - sal_Bool bRet = sal_False; - oslVolumeDeviceHandleImpl* pItem=0; - int nRet; - sal_Char pszCmd[PATH_MAX]; - sal_Char* pszMountProg = "mount"; - sal_Char* pszSuDo = 0; - sal_Char* pszTmp = 0; - - pszCmd[0] = '\0'; - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"In osl_mountFloppy\n"); -#endif - - pItem = (oslVolumeDeviceHandleImpl*) hFloppy; - - if ( pItem == 0 ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_mountFloppy [pItem == 0]\n"); -#endif - - return osl_File_E_INVAL; - } - - if ( pItem->ident[0] != 'O' || pItem->ident[1] != 'V' || pItem->ident[2] != 'D' || pItem->ident[3] != 'H' ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_mountFloppy [invalid handle]\n"); -#endif - return osl_File_E_INVAL; - } - - bRet = osl_isFloppyMounted(pItem); - if ( bRet == sal_True ) - { -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"detected mounted floppy at '%s'\n",pItem->pszMountPoint); -#endif - return osl_File_E_BUSY; - } - - /* mfe: we can't use the mount(2) system call!!! */ - /* even if we are root */ - /* since mtab is not updated!!! */ - /* but we need it to be updated */ - /* some "magic" must be done */ - -/* nRet = mount(pItem->pszDevice,pItem->pszMountPoint,0,0,0); */ -/* if ( nRet != 0 ) */ -/* { */ -/* nRet=errno; */ -/* #ifdef DEBUG_OSL_FILE */ -/* perror("mount"); */ -/* #endif */ -/* } */ - - pszTmp = getenv("SAL_MOUNT_MOUNTPROG"); - if ( pszTmp != 0 ) - { - pszMountProg=pszTmp; - } - - pszTmp=getenv("SAL_MOUNT_SU_DO"); - if ( pszTmp != 0 ) - { - pszSuDo=pszTmp; - } - - if ( pszSuDo != 0 ) - { - snprintf(pszCmd, sizeof(pszCmd), "%s %s %s %s",pszSuDo,pszMountProg,pItem->pszDevice,pItem->pszMountPoint); - } - else - { - snprintf(pszCmd, sizeof(pszCmd), "%s %s",pszMountProg,pItem->pszMountPoint); - } - - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"executing '%s'\n",pszCmd); -#endif - - nRet = system(pszCmd); - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"call returned '%i'\n",nRet); - fprintf(stderr,"exit status is '%i'\n", WEXITSTATUS(nRet)); -#endif - - - switch ( WEXITSTATUS(nRet) ) - { - case 0: - nRet=0; - break; - - case 2: - nRet=EPERM; - break; - - case 4: - nRet=ENOENT; - break; - - case 8: - nRet=EINTR; - break; - - case 16: - nRet=EPERM; - break; - - case 32: - nRet=EBUSY; - break; - - case 64: - nRet=EAGAIN; - break; - - default: - nRet=EBUSY; - break; - } - - return ((0 == nRet) ? oslTranslateFileError(OSL_FET_SUCCESS, nRet) : oslTranslateFileError(OSL_FET_ERROR, nRet)); -} - -static oslFileError osl_unmountFloppy(oslVolumeDeviceHandle hFloppy) -{ - oslVolumeDeviceHandleImpl* pItem=0; - int nRet=0; - sal_Char pszCmd[PATH_MAX]; - sal_Char* pszTmp = 0; - sal_Char* pszSuDo = 0; - sal_Char* pszUmountProg = "umount"; - - pszCmd[0] = '\0'; - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"In osl_unmountFloppy\n"); -#endif - - pItem = (oslVolumeDeviceHandleImpl*) hFloppy; - - if ( pItem == 0 ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_unmountFloppy [pItem==0]\n"); -#endif - return osl_File_E_INVAL; - } - - if ( pItem->ident[0] != 'O' || pItem->ident[1] != 'V' || pItem->ident[2] != 'D' || pItem->ident[3] != 'H' ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_unmountFloppy [invalid handle]\n"); -#endif - return osl_File_E_INVAL; - } - - /* mfe: we can't use the umount(2) system call!!! */ - /* even if we are root */ - /* since mtab is not updated!!! */ - /* but we need it to be updated */ - /* some "magic" must be done */ - -/* nRet=umount(pItem->pszDevice); */ -/* if ( nRet != 0 ) */ -/* { */ -/* nRet = errno; */ - -/* #ifdef DEBUG_OSL_FILE */ -/* perror("mount"); */ -/* #endif */ -/* } */ - - - pszTmp = getenv("SAL_MOUNT_UMOUNTPROG"); - if ( pszTmp != 0 ) - { - pszUmountProg=pszTmp; - } - - pszTmp = getenv("SAL_MOUNT_SU_DO"); - if ( pszTmp != 0 ) - { - pszSuDo=pszTmp; - } - - if ( pszSuDo != 0 ) - { - snprintf(pszCmd, sizeof(pszCmd), "%s %s %s",pszSuDo,pszUmountProg,pItem->pszMountPoint); - } - else - { - snprintf(pszCmd, sizeof(pszCmd), "%s %s",pszUmountProg,pItem->pszMountPoint); - } - - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"executing '%s'\n",pszCmd); -#endif - - nRet = system(pszCmd); - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"call returned '%i'\n",nRet); - fprintf(stderr,"exit status is '%i'\n", WEXITSTATUS(nRet)); -#endif - - switch ( WEXITSTATUS(nRet) ) - { - case 0: - nRet=0; - break; - - default: - nRet=EBUSY; - break; - } - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_unmountFloppy [ok]\n"); -#endif - - return ((0 == nRet) ? oslTranslateFileError(OSL_FET_SUCCESS, nRet) : oslTranslateFileError(OSL_FET_ERROR, nRet)); - -/* return osl_File_E_None;*/ -} - -static sal_Bool osl_getFloppyMountEntry(const sal_Char* pszPath, oslVolumeDeviceHandleImpl* pItem) -{ - struct mntent* pMountEnt=0; - sal_Char buffer[PATH_MAX]; - FILE* mntfile=0; - int nRet=0; - - buffer[0] = '\0'; - - mntfile = setmntent(MOUNTTAB,"r"); - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"In osl_getFloppyMountEntry\n"); -#endif - - memset(buffer, 0, sizeof(buffer)); - strncpy(buffer, pszPath, sizeof(buffer) - 1); - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"Checking mount of %s\n",buffer); -#endif - - - if ( mntfile == 0 ) - { - nRet=errno; -#ifdef DEBUG_OSL_FILE - perror("mounttab"); -#endif -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_getFloppyMountEntry [mntfile]\n"); -#endif - return sal_False; - } - - pMountEnt=getmntent(mntfile); - while ( pMountEnt != 0 ) - { -#ifdef DEBUG_OSL_FILE -/* fprintf(stderr,"mnt_fsname : %s\n",pMountEnt->mnt_fsname); */ -/* fprintf(stderr,"mnt_dir : %s\n",pMountEnt->mnt_dir); */ -/* fprintf(stderr,"mnt_type : %s\n",pMountEnt->mnt_type);*/ -#endif - if ( strcmp(pMountEnt->mnt_dir,buffer) == 0 && - strncmp(pMountEnt->mnt_fsname,"/dev/fd",strlen("/dev/fd")) == 0 ) - { - - memset(pItem->pszMountPoint, 0, sizeof(pItem->pszMountPoint)); - strncpy(pItem->pszMountPoint, pMountEnt->mnt_dir, sizeof(pItem->pszMountPoint) - 1); - - memset(pItem->pszFilePath, 0, sizeof(pItem->pszFilePath)); - strncpy(pItem->pszFilePath, pMountEnt->mnt_dir, sizeof(pItem->pszFilePath) - 1); - - memset(pItem->pszDevice, 0, sizeof(pItem->pszDevice)); - strncpy(pItem->pszDevice, pMountEnt->mnt_fsname, sizeof(pItem->pszDevice) - 1); - - fclose(mntfile); -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"Mount Point found '%s'\n",pItem->pszMountPoint); -#endif -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_getFloppyMountEntry [found]\n"); -#endif - return sal_True; - } -#ifdef DEBUG_OSL_FILE -/* fprintf(stderr,"=================\n");*/ -#endif - pMountEnt=getmntent(mntfile); - } - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_getFloppyMountEntry [not found]\n"); -#endif - - fclose(mntfile); - return sal_False; -} - -static sal_Bool osl_isFloppyMounted(oslVolumeDeviceHandleImpl* pDevice) -{ - sal_Char buffer[PATH_MAX]; - oslVolumeDeviceHandleImpl* pItem=0; - sal_Bool bRet=0; - - buffer[0] = '\0'; - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"In osl_isFloppyMounted\n"); -#endif - - pItem = osl_newVolumeDeviceHandleImpl (); - if ( pItem == 0 ) - return osl_File_E_NOMEM; - - memset(buffer, 0, sizeof(buffer)); - strncpy(buffer, pDevice->pszMountPoint, sizeof(buffer) - 1); - -#ifdef DEBUG_OSL_FILE - fprintf(stderr,"Checking mount of %s\n",buffer); -#endif - - bRet = osl_getFloppyMountEntry(buffer,pItem); - - if ( bRet == sal_False ) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_isFloppyMounted [not mounted]\n"); -#endif - return sal_False; - } - - if (strcmp(pItem->pszMountPoint, pDevice->pszMountPoint) == 0 && - strcmp(pItem->pszDevice,pDevice->pszDevice) == 0) - { -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_isFloppyMounted [is mounted]\n"); -#endif - rtl_freeMemory(pItem); - return sal_True; - } - -#ifdef TRACE_OSL_FILE - fprintf(stderr,"Out osl_isFloppyMounted [may be EBUSY]\n"); -#endif - - rtl_freeMemory(pItem); - return sal_False; -} -#endif /* IRIX */ - - /* NetBSD floppy functions have to be added here. Until we have done that, * we use the MACOSX definitions for nonexistent floppy. * */ diff --git a/sal/osl/unx/module.c b/sal/osl/unx/module.c index d486aad00e01..ffb0ebb61e7b 100644 --- a/sal/osl/unx/module.c +++ b/sal/osl/unx/module.c @@ -35,32 +35,6 @@ #include <osl/process.h> #include <osl/file.h> -#ifdef IRIX -#ifndef _RLD_INTERFACE_DLFCN_H_DLADDR -#define _RLD_INTERFACE_DLFCN_H_DLADDR -typedef struct DL_INFO { - const char * dli_fname; - void * dli_fbase; - const char * dli_sname; - void * dli_saddr; - int dli_version; - int dli_reserved1; - long dli_reserved[4]; -} Dl_info; -#endif -#include <rld_interface.h> -#define _RLD_DLADDR 14 -int dladdr(void *address, Dl_info *dl); - -int dladdr(void *address, Dl_info *dl) -{ - void *v; - v = _rld_new_interface(_RLD_DLADDR,address,dl); - - return (int)v; -} -#endif - #include "system.h" #if OSL_DEBUG_LEVEL > 1 diff --git a/sal/osl/unx/nlsupport.c b/sal/osl/unx/nlsupport.c index e5390089e6d7..5f3741be883e 100644 --- a/sal/osl/unx/nlsupport.c +++ b/sal/osl/unx/nlsupport.c @@ -33,7 +33,7 @@ #include <osl/process.h> #include <rtl/memory.h> -#if defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) +#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) #include <pthread.h> #ifndef MACOSX #include <locale.h> @@ -42,7 +42,7 @@ #include <osl/module.h> #include <osl/thread.h> #endif /* !MACOSX */ -#endif /* LINUX || SOLARIS || IRIX || NETBSD || MACOSX */ +#endif /* LINUX || SOLARIS || NETBSD || MACOSX */ #include <string.h> @@ -229,13 +229,12 @@ static rtl_Locale * _parse_locale( const char * locale ) return NULL; } -#if defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(NETBSD) || defined(FREEBSD) +#if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || defined(FREEBSD) /* * This implementation of osl_getTextEncodingFromLocale maps * from nl_langinfo(CODESET) to rtl_textencoding defines. - * nl_langinfo() is supported only on Linux and Solaris. - * nl_langinfo() is supported only on Linux, Solaris and IRIX, + * nl_langinfo() is supported only on Linux, Solaris, * >= NetBSD 1.6 and >= FreeBSD 4.4 * * This routine is SLOW because of the setlocale call, so @@ -299,24 +298,6 @@ const _pair _nl_language_list[] = { /* XXX MS-874 is an extension to tis620, so this is not * really equivalent */ -#elif defined(IRIX) - -const _pair _nl_language_list[] = { - { "big5", RTL_TEXTENCODING_BIG5 }, /* China - Traditional Chinese */ - { "eucCN", RTL_TEXTENCODING_EUC_CN }, /* China */ - { "eucgbk", RTL_TEXTENCODING_DONTKNOW }, /* China - Simplified Chinese */ - { "eucJP", RTL_TEXTENCODING_EUC_JP }, /* Japan */ - { "eucKR", RTL_TEXTENCODING_EUC_KR }, /* Korea */ - { "eucTW", RTL_TEXTENCODING_EUC_TW }, /* Taiwan - Traditional Chinese */ - { "gbk", RTL_TEXTENCODING_GBK }, /* China - Simplified Chinese */ - { "ISO8859-1", RTL_TEXTENCODING_ISO_8859_1 }, /* Western */ - { "ISO8859-2", RTL_TEXTENCODING_ISO_8859_2 }, /* Central European */ - { "ISO8859-5", RTL_TEXTENCODING_ISO_8859_5 }, /* Cyrillic */ - { "ISO8859-7", RTL_TEXTENCODING_ISO_8859_7 }, /* Greek */ - { "ISO8859-9", RTL_TEXTENCODING_ISO_8859_9 }, /* Turkish */ - { "ISO8859-15", RTL_TEXTENCODING_ISO_8859_15 }, /* Western Updated (w/Euro sign) */ - { "sjis", RTL_TEXTENCODING_SHIFT_JIS } /* Japan */ -}; #elif defined(LINUX) || defined(NETBSD) @@ -552,7 +533,7 @@ const _pair _nl_language_list[] = { { "UTF-8", RTL_TEXTENCODING_UTF8 } /* ISO-10646/UTF-8 */ }; -#endif /* ifdef SOLARIS IRIX LINUX FREEBSD NETBSD */ +#endif /* ifdef SOLARIS LINUX FREEBSD NETBSD */ static pthread_mutex_t aLocalMutex = PTHREAD_MUTEX_INITIALIZER; @@ -927,9 +908,6 @@ void _imp_getProcessLocale( rtl_Locale ** ppLocale ) int _imp_setProcessLocale( rtl_Locale * pLocale ) { -#ifdef IRIX - char env_buf[80]; -#endif char locale_buf[64]; /* convert rtl_Locale to locale string */ @@ -937,11 +915,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) { /* only change env vars that exist already */ if( getenv( "LC_ALL" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LC_ALL=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) setenv( "LC_ALL", locale_buf, 1); #else setenv( "LC_ALL", locale_buf ); @@ -949,11 +923,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) } if( getenv( "LC_CTYPE" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LC_CTYPE=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) setenv("LC_CTYPE", locale_buf, 1 ); #else setenv( "LC_CTYPE", locale_buf ); @@ -961,11 +931,7 @@ int _imp_setProcessLocale( rtl_Locale * pLocale ) } if( getenv( "LANG" ) ) { -#if defined( IRIX ) - snprintf(env_buf, sizeof(env_buf), "LANG=%s", locale_buf); - env_buf[sizeof(env_buf)] = '\0'; - putenv(env_buf); -#elif defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) +#if defined( FREEBSD ) || defined( NETBSD ) || defined( MACOSX ) setenv("LC_CTYPE", locale_buf, 1 ); #else setenv( "LANG", locale_buf ); diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c index a1f47cdf76a5..e3f78ff2f2b4 100644 --- a/sal/osl/unx/process.c +++ b/sal/osl/unx/process.c @@ -49,7 +49,7 @@ #endif #include "system.h" -#if defined(SOLARIS) || defined(IRIX) +#if defined(SOLARIS) # include <sys/procfs.h> #endif #include <osl/diagnose.h> @@ -269,7 +269,7 @@ static sal_Bool sendFdPipe(int PipeFD, int SocketFD) cmptr->cmsg_level = SOL_SOCKET; cmptr->cmsg_type = SCM_RIGHTS; cmptr->cmsg_len = CONTROLLEN; - *(int*)CMSG_DATA(cmptr) = SocketFD; + memcpy(CMSG_DATA(cmptr), &SocketFD, sizeof(int)); #endif @@ -360,7 +360,7 @@ static oslSocket receiveFdPipe(int PipeFD) ( msghdr.msg_controllen == CONTROLLEN ) ) { OSL_TRACE("receiveFdPipe : received '%i' bytes\n",nRead); - newfd = *(int*)CMSG_DATA(cmptr); + memcpy(&newfd, CMSG_DATA(cmptr), sizeof(int)); } #endif else @@ -431,10 +431,8 @@ oslSocket osl_receiveResourcePipe(oslPipe pPipe) static void ChildStatusProc(void *pData) { - int i; -/* int first = 0;*/ - pid_t pid; -/* int status;*/ + pid_t pid = -1; + int status = 0; int channel[2]; ProcessData data; ProcessData *pdata; @@ -447,25 +445,31 @@ static void ChildStatusProc(void *pData) in our child process */ memcpy(&data, pData, sizeof(data)); - socketpair(AF_UNIX, SOCK_STREAM, 0, channel); + if (socketpair(AF_UNIX, SOCK_STREAM, 0, channel) == -1) + status = errno; fcntl(channel[0], F_SETFD, FD_CLOEXEC); fcntl(channel[1], F_SETFD, FD_CLOEXEC); /* Create redirected IO pipes */ + if ( status == 0 && data.m_pInputWrite ) + if (pipe( stdInput ) == -1) + status = errno; - if ( data.m_pInputWrite ) - pipe( stdInput ); - - if ( data.m_pOutputRead ) - pipe( stdOutput ); + if ( status == 0 && data.m_pOutputRead ) + if (pipe( stdOutput ) == -1) + status = errno; - if ( data.m_pErrorRead ) - pipe( stdError ); + if ( status == 0 && data.m_pErrorRead ) + if (pipe( stdError ) == -1) + status = errno; - if ((pid = fork()) == 0) + if ( (status == 0) && ((pid = fork()) == 0) ) { /* Child */ + int chstatus = 0; + sal_Int32 nWrote; + if (channel[0] != -1) close(channel[0]); if ((data.m_uid != (uid_t)-1) && ((data.m_uid != getuid()) || (data.m_gid != getgid()))) @@ -481,20 +485,15 @@ static void ChildStatusProc(void *pData) #endif } - if ((data.m_uid == (uid_t)-1) || ((data.m_uid == getuid()) && (data.m_gid == getgid()))) + if (data.m_pszDir) + chstatus = chdir(data.m_pszDir); + if (chstatus == 0 && ((data.m_uid == (uid_t)-1) || ((data.m_uid == getuid()) && (data.m_gid == getgid())))) { - if (data.m_pszDir) - chdir(data.m_pszDir); - + int i; for (i = 0; data.m_pszEnv[i] != NULL; i++) putenv(data.m_pszEnv[i]); -#if defined(LINUX) && !defined(NPTL) - /* mfe: linux likes to have just one thread when the exec family is called */ - /* this np function has this purpose ... */ - pthread_kill_other_threads_np(); -#endif OSL_TRACE("ChildStatusProc : starting '%s'",data.m_pszArgs[0]); /* Connect std IO to pipe ends */ @@ -537,7 +536,9 @@ static void ChildStatusProc(void *pData) OSL_TRACE("ChildStatusProc : starting '%s' failed",data.m_pszArgs[0]); /* if we reach here, something went wrong */ - write(channel[1], &errno, sizeof(errno)); + nWrote = write(channel[1], &errno, sizeof(errno)); + if (nWrote != sizeof(errno)) + OSL_TRACE("sendFdPipe : sending failed (%s)",strerror(errno)); if (channel[1] != -1) close(channel[1]); @@ -545,8 +546,7 @@ static void ChildStatusProc(void *pData) } else { /* Parent */ - int status; - + int i = -1; if (channel[1] != -1) close(channel[1]); /* Close unused pipe ends */ @@ -554,15 +554,17 @@ static void ChildStatusProc(void *pData) if (stdOutput[1] != -1) close( stdOutput[1] ); if (stdError[1] != -1) close( stdError[1] ); - while (((i = read(channel[0], &status, sizeof(status))) < 0)) + if (pid > 0) { - if (errno != EINTR) - break; + while (((i = read(channel[0], &status, sizeof(status))) < 0)) + { + if (errno != EINTR) + break; + } } if (channel[0] != -1) close(channel[0]); - if ((pid > 0) && (i == 0)) { pid_t child_pid; @@ -1368,48 +1370,6 @@ oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData F return (pInfo->Fields == Fields) ? osl_Process_E_None : osl_Process_E_Unknown; } -#elif defined(IRIX) - - int fd; - sal_Char name[PATH_MAX + 1]; - - snprintf(name, sizeof(name), "/proc/%u", pid); - - if ((fd = open(name, O_RDONLY)) >= 0) - { - prstatus_t prstatus; - prpsinfo_t prpsinfo; - - if (ioctl(fd, PIOCSTATUS, &prstatus) >= 0 && - ioctl(fd, PIOCPSINFO, &prpsinfo) >= 0) - { - if (Fields & osl_Process_CPUTIMES) - { - pInfo->UserTime.Seconds = prstatus.pr_utime.tv_sec; - pInfo->UserTime.Nanosec = prstatus.pr_utime.tv_nsec; - pInfo->SystemTime.Seconds = prstatus.pr_stime.tv_sec; - pInfo->SystemTime.Nanosec = prstatus.pr_stime.tv_nsec; - - pInfo->Fields |= osl_Process_CPUTIMES; - } - - if (Fields & osl_Process_HEAPUSAGE) - { - int pagesize = getpagesize(); - - pInfo->HeapUsage = prpsinfo.pr_size*pagesize; - - pInfo->Fields |= osl_Process_HEAPUSAGE; - } - - close(fd); - - return (pInfo->Fields == Fields) ? osl_Process_E_None : osl_Process_E_Unknown; - } - else - close(fd); - } - #elif defined(LINUX) if ( (Fields & osl_Process_CPUTIMES) || (Fields & osl_Process_HEAPUSAGE) ) diff --git a/sal/osl/unx/profile.c b/sal/osl/unx/profile.c index a01d292e23b6..a0ea4c59ffdd 100644 --- a/sal/osl/unx/profile.c +++ b/sal/osl/unx/profile.c @@ -263,12 +263,9 @@ static oslProfile SAL_CALL osl_psz_openProfile(const sal_Char *pszProfileName, o pProfile->m_Stamp = OslProfile_getFileStamp(pFile); bRet=loadProfile(pFile, pProfile); + bRet &= realpath(pszProfileName, pProfile->m_FileName) != NULL; OSL_ASSERT(bRet); - /* #109261# using osl profiles is deprecated */ - /* OSL_VERIFY(NULL != realpath(pszProfileName, pProfile->m_FileName)); */ - realpath(pszProfileName, pProfile->m_FileName); - if (pProfile->m_pFile == NULL) closeFileImpl(pFile,pProfile->m_Flags); @@ -1338,6 +1335,7 @@ static osl_TStamp closeFileImpl(osl_TFile* pFile, oslProfileOption Flags) static sal_Bool OslProfile_rewindFile(osl_TFile* pFile, sal_Bool bTruncate) { + sal_Bool bRet = sal_True; #ifdef TRACE_OSL_PROFILE OSL_TRACE("In osl_OslProfile_rewindFile\n"); #endif @@ -1349,14 +1347,14 @@ static sal_Bool OslProfile_rewindFile(osl_TFile* pFile, sal_Bool bTruncate) #ifdef DEBUG_OSL_PROFILE OSL_TRACE("rewinding\n"); #endif - lseek(pFile->m_Handle, SEEK_SET, 0L); + bRet = (lseek(pFile->m_Handle, SEEK_SET, 0L) == 0L); if (bTruncate) { #ifdef DEBUG_OSL_PROFILE OSL_TRACE("truncating\n"); #endif - ftruncate(pFile->m_Handle, 0L); + bRet &= (ftruncate(pFile->m_Handle, 0L) == 0); } } @@ -1364,7 +1362,7 @@ static sal_Bool OslProfile_rewindFile(osl_TFile* pFile, sal_Bool bTruncate) #ifdef TRACE_OSL_PROFILE OSL_TRACE("Out osl_OslProfile_rewindFile [ok]\n"); #endif - return (sal_True); + return bRet; } diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c index 310dd57592f5..362f3b0f2644 100644 --- a/sal/osl/unx/socket.c +++ b/sal/osl/unx/socket.c @@ -48,7 +48,7 @@ #undef HAVE_POLL_H #endif -#if defined(LINUX) || defined (IRIX) || defined(NETBSD) || defined ( FREEBSD ) || defined (MACOSX) +#if defined(LINUX) || defined(NETBSD) || defined ( FREEBSD ) || defined (MACOSX) #include <sys/poll.h> #define HAVE_POLL_H #endif /* HAVE_POLL_H */ @@ -1869,10 +1869,13 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket) if ( pSocket->m_bIsAccepting == sal_True ) { int nConnFD; - struct sockaddr aSockAddr; - socklen_t nSockLen = sizeof(aSockAddr); + union { + struct sockaddr aSockAddr; + struct sockaddr_in aSockAddrIn; + } s; + socklen_t nSockLen = sizeof(s.aSockAddr); - nRet = getsockname(nFD, &aSockAddr, &nSockLen); + nRet = getsockname(nFD, &s.aSockAddr, &nSockLen); #if OSL_DEBUG_LEVEL > 1 if ( nRet < 0 ) { @@ -1880,13 +1883,11 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket) } #endif /* OSL_DEBUG_LEVEL */ - if ( aSockAddr.sa_family == AF_INET ) + if ( s.aSockAddr.sa_family == AF_INET ) { - struct sockaddr_in* pSockAddrIn = (struct sockaddr_in*) &aSockAddr; - - if ( pSockAddrIn->sin_addr.s_addr == htonl(INADDR_ANY) ) + if ( s.aSockAddrIn.sin_addr.s_addr == htonl(INADDR_ANY) ) { - pSockAddrIn->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + s.aSockAddrIn.sin_addr.s_addr = htonl(INADDR_LOOPBACK); } nConnFD = socket(AF_INET, SOCK_STREAM, 0); @@ -1897,7 +1898,7 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket) } #endif /* OSL_DEBUG_LEVEL */ - nRet = connect(nConnFD, &aSockAddr, sizeof(aSockAddr)); + nRet = connect(nConnFD, &s.aSockAddr, sizeof(s.aSockAddr)); #if OSL_DEBUG_LEVEL > 1 if ( nRet < 0 ) { diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h index c2e01126fb58..91f3b9fb7ae0 100644 --- a/sal/osl/unx/system.h +++ b/sal/osl/unx/system.h @@ -270,34 +270,6 @@ extern unsigned int nanosleep(unsigned int); # define PTHREAD_SIGACTION cma_sigaction #endif -#ifdef IRIX -# define AF_IPX -1 -# include <pthread.h> -# include <semaphore.h> -# include <sched.h> -# include <sys/socket.h> -# include <sys/un.h> -# include <sys/stropts.h> -# include <netinet/tcp.h> -# include <sys/endian.h> -# if BYTE_ORDER == LITTLE_ENDIAN -# undef _BIG_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == BIG_ENDIAN -# undef _LITTLE_ENDIAN -# undef _PDP_ENDIAN -# elif BYTE_ORDER == PDP_ENDIAN -# undef _LITTLE_ENDIAN -# undef _BIG_ENDIAN -# endif -# define SA_FAMILY_DECL \ - union { struct { short sa_family2; } sa_generic; } sa_union -# define NO_PTHREAD_PRIORITY -# include <dlfcn.h> -# define IOCHANNEL_TRANSFER_BSD -extern char *strdup(const char *); -#endif - #ifdef SOLARIS # include <shadow.h> # include <sys/un.h> @@ -364,8 +336,7 @@ int macxp_resolveAlias(char *path, int buflen); #if !defined(_WIN32) && !defined(_WIN16) && !defined(OS2) && \ !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) && !defined(SCO) && \ !defined(AIX) && !defined(HPUX) && \ - !defined(SOLARIS) && !defined(IRIX) && \ - !defined(MACOSX) + !defined(SOLARIS) && !defined(MACOSX) # error "Target platform not specified!" #endif diff --git a/sal/rtl/source/alloc.c b/sal/rtl/source/alloc.c index 98a4c061e42b..123406717275 100644 --- a/sal/rtl/source/alloc.c +++ b/sal/rtl/source/alloc.c @@ -78,7 +78,7 @@ static sal_Size __rtl_memory_vmpagesize (void) /* xBSD */ return (sal_Size)(getpagesize()); } -#elif defined(IRIX) || defined(LINUX) || defined(SOLARIS) +#elif defined(LINUX) || defined(SOLARIS) static sal_Size __rtl_memory_vmpagesize (void) { /* POSIX */ @@ -90,7 +90,7 @@ static sal_Size __rtl_memory_vmpagesize (void) /* other */ return (sal_Size)(0x2000); } -#endif /* FREEBSD || NETBSD || MACOSX || IRIX || LINUX || SOLARIS */ +#endif /* FREEBSD || NETBSD || MACOSX || LINUX || SOLARIS */ #ifndef PROT_HEAP #define PROT_HEAP (PROT_READ | PROT_WRITE | PROT_EXEC) diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx index 23dab839d558..769251a6c4ec 100644 --- a/sal/rtl/source/bootstrap.cxx +++ b/sal/rtl/source/bootstrap.cxx @@ -820,8 +820,8 @@ void SAL_CALL rtl_bootstrap_set ( rtl_uString * pValue ) SAL_THROW_EXTERN_C() { - OUString const & name = *reinterpret_cast< OUString const * >( &pName ); - OUString const & value = *reinterpret_cast< OUString const * >( &pValue ); + const OUString name( pName ); + const OUString value( pValue ); osl::MutexGuard guard( osl::Mutex::getGlobalMutex() ); diff --git a/sal/rtl/source/macro.hxx b/sal/rtl/source/macro.hxx index 2f0b723d236a..ba274844952e 100644 --- a/sal/rtl/source/macro.hxx +++ b/sal/rtl/source/macro.hxx @@ -49,8 +49,6 @@ #define THIS_OS "NetBSD" #elif defined FREEBSD #define THIS_OS "FreeBSD" -#elif defined IRIX -#define THIS_OS "Irix" #endif #if ! defined THIS_OS @@ -76,8 +74,6 @@ this is inserted for the case that the preprocessor ignores error #else # define THIS_ARCH "SPARC" #endif -#elif defined IRIX -# define THIS_ARCH "MIPS" #elif defined MIPS # ifdef OSL_BIGENDIAN # define THIS_ARCH "MIPS_EB" diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx index a255ca21b13a..012046c9e5c8 100644 --- a/sal/rtl/source/math.cxx +++ b/sal/rtl/source/math.cxx @@ -879,8 +879,13 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, rtl::math::setNan( &fVal ); if (bSign) { - reinterpret_cast< sal_math_Double * >(&fVal)->w32_parts.msw - |= 0x80000000; // create negative NaN + union { + double sd; + sal_math_Double md; + } m; + m.sd = fVal; + m.md.w32_parts.msw |= 0x80000000; // create negative NaN + fVal = m.sd; bSign = false; // don't negate again } // Eat any further digits: diff --git a/sal/util/makefile.mk b/sal/util/makefile.mk index bc8026aa860f..a43f09e2e0e0 100644 --- a/sal/util/makefile.mk +++ b/sal/util/makefile.mk @@ -127,9 +127,6 @@ SHL1STDLIBS= -Bdynamic -ldl -lpthread -lposix4 -lsocket -lnsl SHL1STDLIBS+= -z allextract -staticlib=Crun -z defaultextract .ENDIF # C50 .ENDIF # SOLARIS -.IF "$(OS)"=="IRIX" -SHL1STDLIBS= -lexc -.ENDIF .ENDIF # UNX .IF "$(GUI)"=="OS2" diff --git a/salhelper/source/simplereferenceobject.cxx b/salhelper/source/simplereferenceobject.cxx index 2d80f246d171..36036feb5986 100755 --- a/salhelper/source/simplereferenceobject.cxx +++ b/salhelper/source/simplereferenceobject.cxx @@ -69,7 +69,7 @@ void SimpleReferenceObject::operator delete(void * pPtr) SAL_THROW(()) void SimpleReferenceObject::operator delete(void * pPtr, std::nothrow_t const &) SAL_THROW(()) { -#if defined WNT || (defined IRIX && !defined GCC) +#if defined WNT ::operator delete(pPtr); // WNT lacks a global nothrow operator delete... #else // WNT ::operator delete(pPtr, std::nothrow); |