Issue 17677 - IRIX: psprint/source/helper/ppdparser.cxx fails w/ MipsPro
Summary: IRIX: psprint/source/helper/ppdparser.cxx fails w/ MipsPro
Status: CLOSED WONT_FIX
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: OOo 1.1 RC
Hardware: SGI IRIX
: P3 Trivial (vote)
Target Milestone: AOO PleaseHelp
Assignee: sander_traveling
QA Contact: issues@porting
URL:
Keywords:
Depends on:
Blocks: 809
  Show dependency tree
 
Reported: 2003-07-31 00:26 UTC by nickb
Modified: 2009-09-15 12:34 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description nickb 2003-07-31 00:26:20 UTC
cc-3229 CC: ERROR File =
/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/psprint/source/helper/ppdparser.cxx,
Line = 70
  Specializing class "std::hash<const psp::PPDKey *>" requires "template<>"
          syntax.

  struct std::hash< const psp::PPDKey* >
         ^

1 error detected in the compilation of
"/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/psprint/source/helper/ppdparser.cxx".
dmake:  Error code 2, while making '../../unxirxm3.pro/slo/ppdparser.obj'
---* TG_SLO.MK *---


I'm not even sure what this means...
Comment 1 nickb 2003-07-31 07:46:07 UTC
Hmmm, it looks like
struct std::hash< const psp::PPDKey* >
{
    size_t operator()( const psp::PPDKey * pKey) const
    { return (size_t)pKey; }
};
Is not really valid, as there is no struct name, so things are getting
confused (me included!).

However, if I give it a name, I get this:
CC -c -I.  -I. -I../inc -I../../inc -I../../unx/inc
-I../../unxirxm3.pro/inc -I.
-I/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/solver/645/unxirxm3.pro/inc/stl
-I/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/solver/645/unxirxm3.pro/inc/external
-I/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/solver/645/unxirxm3.pro/inc
-I/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/solenv/unxirxm3/inc
-I/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/solenv/inc
-I/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/res
-I/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/solver/645/unxirxm3.pro/inc/stl
-I/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/solenv/inc/Xp31
-I/usr/java2/include -I/usr/java2/include/irix
-I/usr/java2/include/native_threads/include     -I. -I../../res -I.
-O2   -LANG:ansi-for-init-scope=OFF -LANG:std
-LANG:libc_in_namespace_std=ON -LANG:exceptions=ON   -KPIC -DIRIX
-DUNX -DVCL -DC730 -DC730 -DMIPS -DCVER=C730 -D_USE_NAMESPACE
-DSTLPORT_VERSION=0x450 -D_USE_NAMESPACE=1 -DNEW_SOLAR -DSGI_STL
-D__STL_THROW_RANGE_ERRORS -D__DMAKE -DUNIX -DCPPU_ENV=MipsPro
-DSUPD=645 -DBUILD=8639 -DPRODUCT -DNDEBUG -DPRODUCT_FULL
-DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DEXCEPTIONS_ON -DCUI -DSOLAR_JAVA
-DSRX645  -DSHAREDLIB -D_DLL_  -DMULTITHREAD  -w -o
../../unxirxm3.pro/slo/ppdparser.o
/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/psprint/source/helper/ppdparser.cxx
cc-3597 CC: ERROR File = /usr/include/CC/stl_hashtable.h, Line = 532
  call of an object of a class type without appropriate operator() or
conversion
          functions to pointer-to-function type

      return _M_hash(__key) % __n;
             ^
          A template was detected during header processing.
            instantiation of "std::hashtable<std::pair<const psp::PPDKey
                      *const, const psp::PPDValue *>, const psp::PPDKey *,
                      std::hash<const psp::PPDKey *>,
                      std::_Select1st<std::pair<const psp::PPDKey *const,
                      const psp::PPDValue *>>, std::equal_to<const
psp::PPDKey
                      *>, std::allocator<const psp::PPDValue
*>>::size_type
                      std::hashtable<std::pair<const psp::PPDKey
*const, const
                      psp::PPDValue *>, const psp::PPDKey *,
std::hash<const
                      psp::PPDKey *>, std::_Select1st<std::pair<const
                      psp::PPDKey *const, const psp::PPDValue *>>,
                      std::equal_to<const psp::PPDKey *>,
std::allocator<const
                      psp::PPDValue *>>::_M_bkt_num_key(const
                      std::hashtable<std::pair<const psp::PPDKey
*const, const
                      psp::PPDValue *>, const psp::PPDKey *,
std::hash<const
                      psp::PPDKey *>, std::_Select1st<std::pair<const
                      psp::PPDKey *const, const psp::PPDValue *>>,
                      std::equal_to<const psp::PPDKey *>,
std::allocator<const
                      psp::PPDValue *>>::key_type &, std::size_t)
const" at
                      line 522
            instantiation of "std::hashtable<std::pair<const psp::PPDKey
                      *const, const psp::PPDValue *>, const psp::PPDKey *,
                      std::hash<const psp::PPDKey *>,
                      std::_Select1st<std::pair<const psp::PPDKey *const,
                      const psp::PPDValue *>>, std::equal_to<const
psp::PPDKey
                      *>, std::allocator<const psp::PPDValue
*>>::size_type
                      std::hashtable<std::pair<const psp::PPDKey
*const, const
                      psp::PPDValue *>, const psp::PPDKey *,
std::hash<const
                      psp::PPDKey *>, std::_Select1st<std::pair<const
                      psp::PPDKey *const, const psp::PPDValue *>>,
                      std::equal_to<const psp::PPDKey *>,
std::allocator<const
                      psp::PPDValue *>>::_M_bkt_num_key(const
                      std::hashtable<std::pair<const psp::PPDKey
*const, const
                      psp::PPDValue *>, const psp::PPDKey *,
std::hash<const
                      psp::PPDKey *>, std::_Select1st<std::pair<const
                      psp::PPDKey *const, const psp::PPDValue *>>,
                      std::equal_to<const psp::PPDKey *>,
std::allocator<const
                      psp::PPDValue *>>::key_type &) const" at line 472
            instantiation of "std::hashtable<std::pair<const psp::PPDKey
                      *const, const psp::PPDValue *>, const psp::PPDKey *,
                      std::hash<const psp::PPDKey *>,
                      std::_Select1st<std::pair<const psp::PPDKey *const,
                      const psp::PPDValue *>>, std::equal_to<const
psp::PPDKey
                      *>, std::allocator<const psp::PPDValue
                      *>>::const_iterator std::hashtable<std::pair<const
                      psp::PPDKey *const, const psp::PPDValue *>, const
                      psp::PPDKey *, std::hash<const psp::PPDKey *>,
                      std::_Select1st<std::pair<const psp::PPDKey *const,
                      const psp::PPDValue *>>, std::equal_to<const
psp::PPDKey
                      *>, std::allocator<const psp::PPDValue
*>>::find(const
                      std::hashtable<std::pair<const psp::PPDKey
*const, const
                      psp::PPDValue *>, const psp::PPDKey *,
std::hash<const
                      psp::PPDKey *>, std::_Select1st<std::pair<const
                      psp::PPDKey *const, const psp::PPDValue *>>,
                      std::equal_to<const psp::PPDKey *>,
std::allocator<const
                      psp::PPDValue *>>::key_type &) const" at line 185 of
                      "/usr/include/CC/stl_hash_map.h"
            instantiation of "std::hash_map<const psp::PPDKey *, const
                      psp::PPDValue *, std::hash<const psp::PPDKey *>,
                      std::equal_to<const psp::PPDKey *>,
std::allocator<const
                      psp::PPDValue *>>::const_iterator
std::hash_map<const
                      psp::PPDKey *, const psp::PPDValue *,
std::hash<const
                      psp::PPDKey *>, std::equal_to<const psp::PPDKey *>,
                      std::allocator<const psp::PPDValue *>>::find(const
                      std::hash_map<const psp::PPDKey *, const
psp::PPDValue
                      *, std::hash<const psp::PPDKey *>,
std::equal_to<const
                      psp::PPDKey *>, std::allocator<const psp::PPDValue
                      *>>::key_type &) const" at line 1278 of
                     
"/build1/nickb/openoffice/workarea/11rc/oo_1.1rc_src/pspr
                      int/source/helper/ppdparser.cxx"

Comment 2 nickb 2003-08-01 04:42:57 UTC
Ok, I got it! Moved the struct definition into the header, gave it a
name, and ensured the hash_map's used it!
Index: source/helper/ppdparser.cxx
===================================================================
RCS file: /cvs/gsl/psprint/source/helper/ppdparser.cxx,v
retrieving revision 1.8
diff -u -r1.8 ppdparser.cxx
--- source/helper/ppdparser.cxx 15 Apr 2003 16:14:50 -0000      1.8
+++ source/helper/ppdparser.cxx 1 Aug 2003 03:41:47 -0000
@@ -67,11 +67,19 @@
 // define a hash for PPDKey
 namespace psp { class PPDKey; }

-struct std::hash< const psp::PPDKey* >
+//struct std::hash< const psp::PPDKey* >
+#if 0
+struct std::hash< const psp::PPDKey* >
 {
     size_t operator()( const psp::PPDKey * pKey) const
     { return (size_t)pKey; }
 };
+#else
+//struct  myhash {
+//     size_t operator() ( const psp::PPDKey * pKey) const
+//             { return (size_t)pKey; };
+//};
+#endif

 #include <psprint/ppdparser.hxx>
 #include <tools/debug.hxx>
@@ -97,8 +105,10 @@
 #define DBG_ASSERT( x, y )
 #endif

+//typedef std::hash_map< OUString, OUString, OUStringHash >, myhash>
map_type;
 std::list< PPDParser* > PPDParser::aAllParsers;
 std::hash_map< OUString, OUString, OUStringHash >*
PPDParser::pAllPPDFiles = NULL;
+//map_type * PPDParser::pAllPPDFiles = NULL;
 static String aEmptyString;

 void PPDParser::scanPPDDir( const String& rDir )
@@ -1253,7 +1263,7 @@

 const PPDKey* PPDContext::getModifiedKey( int n ) const
 {
-    ::std::hash_map< const PPDKey*, const PPDValue* >::const_iterator it;
+    ::std::hash_map< const PPDKey*, const PPDValue*
,myhash>::const_iterator it;
     for( it = m_aCurrentValues.begin(); it != m_aCurrentValues.end()
&& n--; ++it )
         ;
     return it != m_aCurrentValues.end() ? it->first : NULL;
@@ -1274,7 +1284,7 @@
     if( ! m_pParser )
         return NULL;

-    ::std::hash_map< const PPDKey*, const PPDValue* >::const_iterator it;
+    ::std::hash_map< const PPDKey*, const PPDValue* ,
myhash>::const_iterator it;
     it = m_aCurrentValues.find( pKey );
     if( it != m_aCurrentValues.end() )
         return it->second;
@@ -1313,7 +1323,7 @@
             m_aCurrentValues[ pKey ] = pValue;

             // after setting this value, check all constraints !
-            ::std::hash_map< const PPDKey*, const PPDValue*
>::iterator it = m_aCurrentValues.begin();
+            ::std::hash_map< const PPDKey*, const PPDValue* ,
myhash>::iterator it = m_aCurrentValues.begin();
             while(  it != m_aCurrentValues.end() )
             {
                 if( it->first != pKey &&
@@ -1506,7 +1516,7 @@
     int i;
     if( ! m_aCurrentValues.size() )
         return NULL;
-    ::std::hash_map< const PPDKey*, const PPDValue* >::const_iterator it;
+    ::std::hash_map< const PPDKey*, const PPDValue* ,
myhash>::const_iterator it;
     for( it = m_aCurrentValues.begin(); it != m_aCurrentValues.end();
++it )
     {
         ByteString aCopy( it->first->getKey(),
RTL_TEXTENCODING_MS_1252 );
Index: inc/psprint/ppdparser.hxx
===================================================================
RCS file: /cvs/gsl/psprint/inc/psprint/ppdparser.hxx,v
retrieving revision 1.4
diff -u -r1.4 ppdparser.hxx
--- inc/psprint/ppdparser.hxx   11 Apr 2003 17:17:50 -0000      1.4
+++ inc/psprint/ppdparser.hxx   1 Aug 2003 03:41:47 -0000
@@ -306,10 +306,15 @@
  * PPDContext - a class to manage user definable states based on the
  * contents of a PPDParser.
  */
+struct  myhash {
+        size_t operator() ( const psp::PPDKey * pKey) const
+                { return (size_t)pKey; };
+};
+

 class PPDContext
 {
-    ::std::hash_map< const PPDKey*, const PPDValue* >   m_aCurrentValues;
+    ::std::hash_map< const PPDKey*, const PPDValue* , myhash>  
m_aCurrentValues;
     const PPDParser*                                    m_pParser;

     // returns false: check failed, new value is constrained
Comment 3 Martin Hollmichel 2003-08-07 15:56:49 UTC
set target milestone to 1.1.1
Comment 4 Martin Hollmichel 2003-10-17 08:21:32 UTC
reassigned.
Comment 5 caolanm 2009-09-15 12:34:26 UTC
There's no point have this bug open anymore. svesik doesn't work on OOo anymore,
and the module in question "psprint" no longer exists. Though parts of it have
been moved into vcl.
Comment 6 caolanm 2009-09-15 12:34:51 UTC
closing