From 87aaa3d68dbf050b28afb2a9af0a6b46bc982ae0 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 31 Oct 2000 01:48:02 +0000 Subject: [PATCH] *** empty log message *** --- dtool/pptempl/Depends.pp | 4 +- dtool/pptempl/Global.pp | 8 ++-- dtool/pptempl/Template.msvc.pp | 51 ++++++++++++---------- dtool/src/dtoolutil/filename.cxx | 4 ++ panda/src/mathutil/rotate_to.h | 8 ++-- panda/src/net/connectionManager.cxx | 21 +++++++++ panda/src/net/connectionManager.h | 2 + pandatool/src/bam/Sources.pp | 8 ++-- pandatool/src/eggbase/Sources.pp | 4 +- pandatool/src/eggbase/eggWriter.cxx | 3 +- pandatool/src/eggbase/eggWriter.h | 2 - pandatool/src/eggbase/somethingToEgg.cxx | 2 +- pandatool/src/eggprogs/Sources.pp | 4 +- pandatool/src/flt/Sources.pp | 4 +- pandatool/src/gtkbase/Sources.pp | 4 +- pandatool/src/imagebase/Sources.pp | 4 +- pandatool/src/imagebase/imageWriter.h | 2 - pandatool/src/imageprogs/Sources.pp | 3 +- pandatool/src/maya/mayaFile.cxx | 2 - pandatool/src/pandatoolbase/Sources.pp | 4 +- pandatool/src/progbase/Sources.pp | 4 +- pandatool/src/progbase/programBase.cxx | 2 +- pandatool/src/progbase/programBase.h | 6 +-- pandatool/src/progbase/wordWrapStream.h | 2 +- pandatool/src/pstatserver/Sources.pp | 4 +- pandatool/src/pstatserver/pStatGraph.cxx | 35 ++++++++++++--- pandatool/src/pstatserver/pStatGraph.h | 3 ++ pandatool/src/pstatserver/pStatReader.cxx | 7 ++- pandatool/src/stitch/Sources.pp | 8 +++- pandatool/src/stitchbase/Sources.pp | 4 +- pandatool/src/stitchbase/config_stitch.h | 4 +- pandatool/src/stitchbase/layeredImage.cxx | 14 +++--- pandatool/src/stitchbase/morphGrid.cxx | 1 + pandatool/src/stitchbase/morphGrid.h | 1 + pandatool/src/stitchbase/stitchFile.cxx | 2 - pandatool/src/stitchbase/stitchLexer.lxx | 17 +++----- pandatool/src/stitchbase/stitchLexerDefs.h | 4 +- pandatool/src/stitchviewer/Sources.pp | 4 +- pandatool/src/stitchviewer/triangleMesh.h | 13 +++--- pandatool/src/text-stats/Sources.pp | 4 +- 40 files changed, 167 insertions(+), 116 deletions(-) diff --git a/dtool/pptempl/Depends.pp b/dtool/pptempl/Depends.pp index 3843a2b8a7..9ac5d52dc1 100644 --- a/dtool/pptempl/Depends.pp +++ b/dtool/pptempl/Depends.pp @@ -10,7 +10,7 @@ #if $[eq $[DEPEND_DIRS],] #define DEPENDABLE_HEADERS - #forscopes metalib_target static_lib_target lib_target noinst_lib_target bin_target noinst_bin_target + #forscopes metalib_target static_lib_target ss_lib_target lib_target noinst_lib_target bin_target noinst_bin_target // We can optimize quite a bit by evaluating now several of the key // deferred variables defined in Globals.pp. This way they won't need // to get repeatedly reevaluated as each directory examines each @@ -29,7 +29,7 @@ Warning: Lib(s) $[nonexisting], referenced in $[DIRNAME]/$[TARGET], not found. #endif #set DEPENDABLE_HEADERS $[DEPENDABLE_HEADERS] $[filter %.h %.I,$[SOURCES]] - #end metalib_target static_lib_target lib_target noinst_lib_target bin_target noinst_bin_target + #end metalib_target static_lib_target ss_lib_target lib_target noinst_lib_target bin_target noinst_bin_target // Allow the user to define additional EXTRA_DEPENDS targets in each // Sources.pp. diff --git a/dtool/pptempl/Global.pp b/dtool/pptempl/Global.pp index ed04394f20..1c3f79e5d4 100644 --- a/dtool/pptempl/Global.pp +++ b/dtool/pptempl/Global.pp @@ -35,13 +35,13 @@ // variable as set for the dconfig library (that is, the expression // $[SOURCES] is evaluated within the named scope whose key is // "dconfig"--whose variable $[TARGET] was defined to be "dconfig"). -#map all_libs TARGET(*/static_lib_target */lib_target */noinst_lib_target */metalib_target) +#map all_libs TARGET(*/static_lib_target */ss_lib_target */lib_target */noinst_lib_target */metalib_target) // These allow us to determine whether a particular local library is a // static or a dynamic library. If the library name appears in the // static_libs map, it is a static library (i.e. libname.a); // otherwise, it is a dynamic library (libname.so). -#map static_libs TARGET(*/static_lib_target) +#map static_libs TARGET(*/static_lib_target */ss_lib_target) #map dynamic_libs TARGET(*/lib_target */noinst_lib_target */metalib_target) // This lets us identify which metalib, if any, is including each @@ -507,7 +507,7 @@ #end lib_target noinst_lib_target // These will never be part of a metalib. - #forscopes static_lib_target bin_target noinst_bin_target metalib_target + #forscopes static_lib_target ss_lib_target bin_target noinst_bin_target metalib_target #foreach depend $[LOCAL_LIBS] #define depend_metalib $[module $[TARGET],$[depend]] #if $[ne $[depend_metalib],] @@ -518,7 +518,7 @@ #set depend_libs $[depend_libs] $[depend] #endif #end depend - #end static_lib_target bin_target noinst_bin_target metalib_target + #end static_lib_target ss_lib_target bin_target noinst_bin_target metalib_target // In case we're defining any metalibs, these depend directly on // their components as well. diff --git a/dtool/pptempl/Template.msvc.pp b/dtool/pptempl/Template.msvc.pp index db4e23ad3e..84586c352d 100644 --- a/dtool/pptempl/Template.msvc.pp +++ b/dtool/pptempl/Template.msvc.pp @@ -54,7 +54,7 @@ // list of binaries that are to be built only when specifically asked // for. #define lib_targets $[patsubst %,$[so_dir]\lib%$[dllext].dll,$[active_target(metalib_target noinst_lib_target)] $[real_lib_targets]] -#define static_lib_targets $[active_target(static_lib_target):%=$[st_dir]\lib%$[dllext].lib] +#define static_lib_targets $[active_target(static_lib_target ss_lib_target):%=$[st_dir]\lib%$[dllext].lib] #define bin_targets \ $[active_target(bin_target noinst_bin_target):%=$[st_dir]\%.exe] \ $[active_target(sed_bin_target):%=$[st_dir]\%] @@ -62,13 +62,13 @@ // And these variables will define the various things we need to // install. -#define install_lib $[active_target(metalib_target static_lib_target)] $[real_lib_targets] +#define install_lib $[active_target(metalib_target static_lib_target ss_lib_target)] $[real_lib_targets] #define install_bin $[active_target(bin_target)] -#define install_scripts $[sort $[INSTALL_SCRIPTS(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_SCRIPTS]] -#define install_headers $[sort $[INSTALL_HEADERS(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_HEADERS]] +#define install_scripts $[sort $[INSTALL_SCRIPTS(metalib_target lib_target static_lib_target ss_lib_target bin_target)] $[INSTALL_SCRIPTS]] +#define install_headers $[sort $[INSTALL_HEADERS(metalib_target lib_target static_lib_target ss_lib_target bin_target)] $[INSTALL_HEADERS]] #define install_parser_inc $[sort $[INSTALL_PARSER_INC]] -#define install_data $[sort $[INSTALL_DATA(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_DATA]] -#define install_config $[sort $[INSTALL_CONFIG(metalib_target lib_target static_lib_target bin_target)] $[INSTALL_CONFIG]] +#define install_data $[sort $[INSTALL_DATA(metalib_target lib_target static_lib_target ss_lib_target bin_target)] $[INSTALL_DATA]] +#define install_config $[sort $[INSTALL_CONFIG(metalib_target lib_target static_lib_target ss_lib_target bin_target)] $[INSTALL_CONFIG]] #define install_igatedb $[sort $[get_igatedb(metalib_target lib_target)]] // $[so_sources] is the set of sources that belong on a shared object, @@ -77,7 +77,7 @@ // don't need to make this distinction, but we do anyway in case we // might in the future for some nutty reason. #define so_sources $[get_sources(metalib_target lib_target noinst_lib_target)] -#define st_sources $[get_sources(static_lib_target bin_target noinst_bin_target test_bin_target)] +#define st_sources $[get_sources(static_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target)] // These are the source files that our dependency cache file will // depend on. If it's an empty list, we won't bother writing rules to @@ -106,7 +106,7 @@ // which to build a particular source file, since some targets may // have different requirements (e.g. different local_libs, or // different USE_this or USE_that) than other targets. -#map all_sources get_sources(metalib_target lib_target noinst_lib_target static_lib_target bin_target noinst_bin_target test_bin_target) +#map all_sources get_sources(metalib_target lib_target noinst_lib_target static_lib_target ss_lib_target bin_target noinst_bin_target test_bin_target) // We define $[complete_local_libs] as the full set of libraries (from // within this tree) that we must link a particular target with. It @@ -214,13 +214,13 @@ cleanall : clean $[if $[install_config],$[install_config_dir]] \ $[if $[install_igatedb],$[install_igatedb_dir]] \ ] \ - $[active_target(metalib_target lib_target static_lib_target):%=install-lib%] \ + $[active_target(metalib_target lib_target static_lib_target ss_lib_target):%=install-lib%] \ $[active_target(bin_target sed_bin_target):%=install-%] \ $[installed_files] install : all $[install_targets] -uninstall : $[active_target(metalib_target lib_target static_lib_target):%=uninstall-lib%] $[active_target(bin_target):%=uninstall-%] +uninstall : $[active_target(metalib_target lib_target static_lib_target ss_lib_target):%=uninstall-lib%] $[active_target(bin_target):%=uninstall-%] #if $[installed_files] del /f $[sort $[installed_files]] #endif @@ -297,9 +297,10 @@ $[osfilename $[directory]] : #define sources \ $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[so_dir]\%.obj,%,,$[get_sources] $[igateoutput] $[igatemout]]] \ $[components $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[RELDIR]\$[so_dir]\%.obj,%,,$[get_sources] $[get_igateoutput]]],$[active_component_libs]] -lib_$[TARGET]_so = $[osfilename $[sources]] +#define varname $[subst -,_,lib$[TARGET]_so] +$[varname] = $[osfilename $[sources]] #define target $[so_dir]\lib$[TARGET]$[dllext].dll - #define sources $(lib_$[TARGET]_so) + #define sources $($[varname]) $[target] : $[sources] #if $[filter %.cxx %.yxx %.lxx,$[get_sources]] $[SHARED_LIB_C++] @@ -357,7 +358,7 @@ $[install_igatedb_dir]\$[igatedb] : $[so_dir]\$[igatedb] copy $[so_dir]\$[local] $[dest] lib$[TARGET]_igatescan = $[osfilename $[igatescan]] -$[so_dir]\$[igatedb] $[so_dir]\$[igateoutput] : $[filter-out .c .cxx,$[igatescan]] +$[so_dir]\$[igatedb] $[so_dir]\$[igateoutput] : $[filter-out %.c %.cxx,$[igatescan]] // We use forward slash for interrogate because it prefers those. interrogate -od $[so_dir]/$[igatedb] -oc $[so_dir]/$[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan) @@ -405,9 +406,10 @@ $[target] : $[source] ///////////////////////////////////////////////////////////////////// #forscopes noinst_lib_target -lib_$[TARGET]_so = $[osfilename $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[so_dir]\%.obj,%,,$[get_sources]]]] +#define varname $[subst -,_,lib$[TARGET]_so] +$[varname] = $[osfilename $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[so_dir]\%.obj,%,,$[get_sources]]]] #define target $[so_dir]\lib$[TARGET]$[dllext].dll -#define sources $(lib_$[TARGET]_so) +#define sources $($[varname]) $[target] : $[sources] #if $[filter %.cxx %.yxx %.lxx,$[get_sources]] $[SHARED_LIB_C++] @@ -425,10 +427,11 @@ $[target] : $[sources] // a metalib, making the rules relatively simple. ///////////////////////////////////////////////////////////////////// -#forscopes static_lib_target -lib_$[TARGET]_a = $[osfilename $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[st_dir]\%.obj,%,,$[get_sources]]]] +#forscopes static_lib_target ss_lib_target +#define varname $[subst -,_,lib$[TARGET]_a] +$[varname] = $[osfilename $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[st_dir]\%.obj,%,,$[get_sources]]]] #define target $[st_dir]\lib$[TARGET]$[dllext].lib -#define sources $(lib_$[TARGET]_a) +#define sources $($[varname]) $[target] : $[sources] #if $[filter %.cxx %.yxx %.lxx,$[get_sources]] $[STATIC_LIB_C++] @@ -455,7 +458,7 @@ $[install_lib_dir]\lib$[TARGET]$[dllext].lib : $[st_dir]\lib$[TARGET]$[dllext].l #define dest $[install_lib_dir] copy $[st_dir]\$[local] $[dest] -#end static_lib_target +#end static_lib_target ss_lib_target @@ -500,9 +503,10 @@ $[install_bin_dir]\$[TARGET] : $[st_dir]\$[TARGET] #forscopes bin_target $[TARGET] : $[st_dir]\$[TARGET].exe -bin_$[TARGET] = $[osfilename $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[st_dir]\%.obj,%,,$[get_sources]]]] +#define varname $[subst -,_,bin_$[TARGET]] +$[varname] = $[osfilename $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[st_dir]\%.obj,%,,$[get_sources]]]] #define target $[st_dir]\$[TARGET].exe -#define sources $(bin_$[TARGET]) +#define sources $($[varname]) #define ld $[get_ld] $[target] : $[sources] #if $[ld] @@ -548,9 +552,10 @@ $[install_bin_dir]\$[TARGET].exe : $[st_dir]\$[TARGET].exe #forscopes noinst_bin_target test_bin_target $[TARGET] : $[st_dir]\$[TARGET].exe -bin_$[TARGET] = $[osfilename $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[st_dir]\%.obj,%,,$[get_sources]]]] +#define varname $[subst -,_,bin_$[TARGET]] +$[varname] = $[osfilename $[unique $[patsubst %.cxx %.c %.yxx %.lxx,$[st_dir]\%.obj,%,,$[get_sources]]]] #define target $[st_dir]\$[TARGET].exe -#define sources $(bin_$[TARGET]) +#define sources $($[varname]) $[target] : $[sources] #if $[filter %.cxx %.yxx %.lxx,$[get_sources]] $[LINK_BIN_C++] diff --git a/dtool/src/dtoolutil/filename.cxx b/dtool/src/dtoolutil/filename.cxx index 4e3645d75f..907369141e 100644 --- a/dtool/src/dtoolutil/filename.cxx +++ b/dtool/src/dtoolutil/filename.cxx @@ -677,6 +677,7 @@ open_read(ifstream &stream) const { } #endif + stream.clear(); stream.open(to_os_specific().c_str(), open_mode); return (!stream.fail()); } @@ -706,6 +707,7 @@ open_write(ofstream &stream) const { } #endif + stream.clear(); #ifdef WIN32_VC stream.open(to_os_specific().c_str(), open_mode); #else @@ -740,6 +742,7 @@ open_append(ofstream &stream) const { } #endif + stream.clear(); #ifdef WIN32_VC stream.open(to_os_specific().c_str(), open_mode); #else @@ -774,6 +777,7 @@ open_read_write(fstream &stream) const { } #endif + stream.clear(); #ifdef WIN32_VC stream.open(to_os_specific().c_str(), open_mode); #else diff --git a/panda/src/mathutil/rotate_to.h b/panda/src/mathutil/rotate_to.h index 089967641d..0743b0bf38 100644 --- a/panda/src/mathutil/rotate_to.h +++ b/panda/src/mathutil/rotate_to.h @@ -22,10 +22,10 @@ #include "lmatrix.h" #include "luse.h" -void rotate_to(LMatrix3f &mat, const LVector3f &a, const LVector3f &b); -void rotate_to(LMatrix3d &mat, const LVector3d &a, const LVector3d &b); +EXPCL_PANDA void rotate_to(LMatrix3f &mat, const LVector3f &a, const LVector3f &b); +EXPCL_PANDA void rotate_to(LMatrix3d &mat, const LVector3d &a, const LVector3d &b); -void rotate_to(LMatrix4f &mat, const LVector3f &a, const LVector3f &b); -void rotate_to(LMatrix4d &mat, const LVector3d &a, const LVector3d &b); +EXPCL_PANDA void rotate_to(LMatrix4f &mat, const LVector3f &a, const LVector3f &b); +EXPCL_PANDA void rotate_to(LMatrix4d &mat, const LVector3d &a, const LVector3d &b); #endif diff --git a/panda/src/net/connectionManager.cxx b/panda/src/net/connectionManager.cxx index 3bb1f40cff..b16f948576 100644 --- a/panda/src/net/connectionManager.cxx +++ b/panda/src/net/connectionManager.cxx @@ -13,6 +13,10 @@ #include +#ifdef WIN32_VC +#include // For gethostname() +#endif + //////////////////////////////////////////////////////////////////// // Function: ConnectionManager::Constructor // Access: Public @@ -252,6 +256,23 @@ close_connection(const PT(Connection) &connection) { return true; } +//////////////////////////////////////////////////////////////////// +// Function: ConnectionManager::get_host_name +// Access: Public, Static +// Description: Returns the name of this particular machine on the +// network, if available, or the empty string if the +// hostname cannot be determined. +//////////////////////////////////////////////////////////////////// +string ConnectionManager:: +get_host_name() { + char temp_buff[1024]; + if (gethostname(temp_buff, 1024) == 0) { + return string(temp_buff); + } + + return string(); +} + //////////////////////////////////////////////////////////////////// // Function: ConnectionManager::new_connection // Access: Protected diff --git a/panda/src/net/connectionManager.h b/panda/src/net/connectionManager.h index 7aabbf19cc..4cc8c259e0 100644 --- a/panda/src/net/connectionManager.h +++ b/panda/src/net/connectionManager.h @@ -49,6 +49,8 @@ public: int timeout_ms); bool close_connection(const PT(Connection) &connection); + + static string get_host_name(); protected: void new_connection(const PT(Connection) &connection); diff --git a/pandatool/src/bam/Sources.pp b/pandatool/src/bam/Sources.pp index 723ce483a2..28e414118a 100644 --- a/pandatool/src/bam/Sources.pp +++ b/pandatool/src/bam/Sources.pp @@ -4,8 +4,8 @@ eggbase progbase #define OTHER_LIBS \ loader:c egg:c sgraphutil:c sgattrib:c sgraph:c pnmimagetypes:c \ - graph:c putil:c express:c panda:m \ - interrogatedb:c dtoolutil:c dconfig:c dtool:m + graph:c putil:c express:c panda:m pandaexpress:m \ + interrogatedb:c dtoolutil:c dconfig:c dtool:m pystub #define UNIX_SYS_LIBS \ m @@ -22,8 +22,8 @@ eggbase progbase #define OTHER_LIBS \ loader:c egg2sg:c builder:c egg:c pnmimagetypes:c graph:c putil:c \ - express:c panda:m interrogatedb:c \ - interrogatedb:c dtoolutil:c dconfig:c dtool:m + express:c pandaegg:m panda:m pandaexpress:m \ + interrogatedb:c dtoolutil:c dconfig:c dtool:m pystub #define UNIX_SYS_LIBS \ m diff --git a/pandatool/src/eggbase/Sources.pp b/pandatool/src/eggbase/Sources.pp index 7368cb2cbc..33291dfa79 100644 --- a/pandatool/src/eggbase/Sources.pp +++ b/pandatool/src/eggbase/Sources.pp @@ -1,4 +1,4 @@ -#begin lib_target +#begin ss_lib_target #define TARGET eggbase #define LOCAL_LIBS \ progbase @@ -15,5 +15,5 @@ eggBase.h eggConverter.h eggFilter.h eggReader.h eggToSomething.h \ eggWriter.h somethingToEgg.h -#end lib_target +#end ss_lib_target diff --git a/pandatool/src/eggbase/eggWriter.cxx b/pandatool/src/eggbase/eggWriter.cxx index 67f7ea958c..d1538a2af3 100644 --- a/pandatool/src/eggbase/eggWriter.cxx +++ b/pandatool/src/eggbase/eggWriter.cxx @@ -96,8 +96,7 @@ get_output() { } else { // Attempt to open the named file. unlink(_output_filename.c_str()); - _output_stream.open(_output_filename.c_str(), ios::out, 0666); - if (!_output_stream) { + if (!_output_filename.open_write(_output_stream)) { nout << "Unable to write to " << _output_filename << "\n"; exit(1); } diff --git a/pandatool/src/eggbase/eggWriter.h b/pandatool/src/eggbase/eggWriter.h index 7edf7e4f32..34857d1a59 100644 --- a/pandatool/src/eggbase/eggWriter.h +++ b/pandatool/src/eggbase/eggWriter.h @@ -12,8 +12,6 @@ #include -#include - //////////////////////////////////////////////////////////////////// // Class : EggWriter // Description : This is the base class for a program that generates diff --git a/pandatool/src/eggbase/somethingToEgg.cxx b/pandatool/src/eggbase/somethingToEgg.cxx index a4ee58ab04..8763cbb23b 100644 --- a/pandatool/src/eggbase/somethingToEgg.cxx +++ b/pandatool/src/eggbase/somethingToEgg.cxx @@ -77,7 +77,7 @@ handle_args(Args &args) { _input_filename = args[0]; - if (access(_input_filename.c_str(), R_OK) != 0) { + if (!_input_filename.exists()) { nout << "Cannot find input file " << _input_filename << "\n"; return false; } diff --git a/pandatool/src/eggprogs/Sources.pp b/pandatool/src/eggprogs/Sources.pp index 79e16de061..52ccbf0231 100644 --- a/pandatool/src/eggprogs/Sources.pp +++ b/pandatool/src/eggprogs/Sources.pp @@ -5,8 +5,8 @@ #define LOCAL_LIBS \ eggbase progbase #define OTHER_LIBS \ - egg:c linmath:c putil:c express:c panda:m \ - dtoolutil:c dconfig:c dtool:m + egg:c linmath:c putil:c express:c pandaegg:m panda:m pandaexpress:m \ + dtoolutil:c dconfig:c dtool:m pystub #define UNIX_SYS_LIBS \ m diff --git a/pandatool/src/flt/Sources.pp b/pandatool/src/flt/Sources.pp index 9492148128..77679e127a 100644 --- a/pandatool/src/flt/Sources.pp +++ b/pandatool/src/flt/Sources.pp @@ -1,4 +1,4 @@ -#begin lib_target +#begin ss_lib_target #define TARGET flt #define LOCAL_LIBS pandatoolbase #define OTHER_LIBS \ @@ -43,7 +43,7 @@ fltTransformTranslate.h fltUnsupportedRecord.h fltVertex.I \ fltVertex.h fltVertexList.h -#end lib_target +#end ss_lib_target #begin test_bin_target #define TARGET test_flt diff --git a/pandatool/src/gtkbase/Sources.pp b/pandatool/src/gtkbase/Sources.pp index 6b28460c08..eb7eb1eec4 100644 --- a/pandatool/src/gtkbase/Sources.pp +++ b/pandatool/src/gtkbase/Sources.pp @@ -1,7 +1,7 @@ #define DIRECTORY_IF_GTKMM yes #define USE_GTKMM yes -#begin lib_target +#begin ss_lib_target #define TARGET gtkbase #define LOCAL_LIBS \ progbase @@ -14,5 +14,5 @@ #define INSTALL_HEADERS \ basicGtkDialog.h basicGtkWindow.h gtkBase.h request_initial_size.h -#end lib_target +#end ss_lib_target diff --git a/pandatool/src/imagebase/Sources.pp b/pandatool/src/imagebase/Sources.pp index f3e0903acc..ab34a911d1 100644 --- a/pandatool/src/imagebase/Sources.pp +++ b/pandatool/src/imagebase/Sources.pp @@ -1,4 +1,4 @@ -#begin lib_target +#begin ss_lib_target #define TARGET imagebase #define LOCAL_LIBS \ progbase @@ -13,5 +13,5 @@ #define INSTALL_HEADERS \ imageBase.h imageFilter.h imageReader.h imageWriter.I imageWriter.h -#end lib_target +#end ss_lib_target diff --git a/pandatool/src/imagebase/imageWriter.h b/pandatool/src/imagebase/imageWriter.h index 01eeed0c85..aa70ffa289 100644 --- a/pandatool/src/imagebase/imageWriter.h +++ b/pandatool/src/imagebase/imageWriter.h @@ -12,8 +12,6 @@ #include -#include - //////////////////////////////////////////////////////////////////// // Class : ImageWriter // Description : This is the base class for a program that generates diff --git a/pandatool/src/imageprogs/Sources.pp b/pandatool/src/imageprogs/Sources.pp index d6e875dc66..168355b767 100644 --- a/pandatool/src/imageprogs/Sources.pp +++ b/pandatool/src/imageprogs/Sources.pp @@ -5,7 +5,8 @@ #define LOCAL_LIBS \ imagebase progbase #define OTHER_LIBS \ - pnmimagetypes:c pnmimage:c putil:c express:c panda:m dtool + pnmimagetypes:c pnmimage:c putil:c express:c panda:m \ + pandaexpress:m dtool pystub #define UNIX_SYS_LIBS \ m diff --git a/pandatool/src/maya/mayaFile.cxx b/pandatool/src/maya/mayaFile.cxx index 78754ea83d..5d40c0ac8d 100644 --- a/pandatool/src/maya/mayaFile.cxx +++ b/pandatool/src/maya/mayaFile.cxx @@ -15,8 +15,6 @@ #include #include -#include - #include #include #include diff --git a/pandatool/src/pandatoolbase/Sources.pp b/pandatool/src/pandatoolbase/Sources.pp index 03b8ec4a77..e7ec1a38e6 100644 --- a/pandatool/src/pandatoolbase/Sources.pp +++ b/pandatool/src/pandatoolbase/Sources.pp @@ -1,4 +1,4 @@ -#begin lib_target +#begin ss_lib_target #define TARGET pandatoolbase #define SOURCES \ @@ -7,4 +7,4 @@ #define INSTALL_HEADERS \ pandatoolbase.h -#end lib_target +#end ss_lib_target diff --git a/pandatool/src/progbase/Sources.pp b/pandatool/src/progbase/Sources.pp index a8341b437a..2380348ed3 100644 --- a/pandatool/src/progbase/Sources.pp +++ b/pandatool/src/progbase/Sources.pp @@ -1,4 +1,4 @@ -#begin lib_target +#begin ss_lib_target #define TARGET progbase #define LOCAL_LIBS \ pandatoolbase @@ -14,7 +14,7 @@ programBase.I programBase.h wordWrapStream.h wordWrapStreamBuf.I \ wordWrapStreamBuf.h -#end lib_target +#end ss_lib_target #begin test_bin_target #define TARGET test_prog diff --git a/pandatool/src/progbase/programBase.cxx b/pandatool/src/progbase/programBase.cxx index 39623065d3..6e898e7396 100644 --- a/pandatool/src/progbase/programBase.cxx +++ b/pandatool/src/progbase/programBase.cxx @@ -233,7 +233,7 @@ parse_command_line(int argc, char *argv[]) { // Now add it to the GNU data structures. struct option gopt; - gopt.name = opt._option.c_str(); + gopt.name = (char *)opt._option.c_str(); gopt.has_arg = (opt._parm_name.empty()) ? no_argument : required_argument; gopt.flag = (int *)NULL; diff --git a/pandatool/src/progbase/programBase.h b/pandatool/src/progbase/programBase.h index c78e441355..6b9ef1041c 100644 --- a/pandatool/src/progbase/programBase.h +++ b/pandatool/src/progbase/programBase.h @@ -9,8 +9,8 @@ #include #include +#include -#include #include #include #include @@ -36,7 +36,7 @@ public: virtual void parse_command_line(int argc, char *argv[]); - typedef vector Args; + typedef vector_string Args; Filename _program_name; Args _program_args; @@ -94,7 +94,7 @@ private: }; string _description; - typedef vector Runlines; + typedef vector_string Runlines; Runlines _runlines; typedef map OptionsByName; diff --git a/pandatool/src/progbase/wordWrapStream.h b/pandatool/src/progbase/wordWrapStream.h index f303aa93c9..ec49949058 100644 --- a/pandatool/src/progbase/wordWrapStream.h +++ b/pandatool/src/progbase/wordWrapStream.h @@ -23,7 +23,7 @@ // force a line break without a paragraph break, use // '\r'. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA WordWrapStream : public ostream { +class WordWrapStream : public ostream { public: WordWrapStream(ProgramBase *program); diff --git a/pandatool/src/pstatserver/Sources.pp b/pandatool/src/pstatserver/Sources.pp index 9278b77568..8e4a720585 100644 --- a/pandatool/src/pstatserver/Sources.pp +++ b/pandatool/src/pstatserver/Sources.pp @@ -1,7 +1,7 @@ #define DIRECTORY_IF_NET yes #define USE_NET yes -#begin lib_target +#begin ss_lib_target #define TARGET pstatserver #define LOCAL_LIBS pandatoolbase #define OTHER_LIBS \ @@ -26,5 +26,5 @@ pStatThreadData.I pStatThreadData.h pStatView.I pStatView.h \ pStatViewLevel.I pStatViewLevel.h -#end lib_target +#end ss_lib_target diff --git a/pandatool/src/pstatserver/pStatGraph.cxx b/pandatool/src/pstatserver/pStatGraph.cxx index 8b96183d3c..d69ff62e20 100644 --- a/pandatool/src/pstatserver/pStatGraph.cxx +++ b/pandatool/src/pstatserver/pStatGraph.cxx @@ -12,6 +12,32 @@ #include // for sprintf +//////////////////////////////////////////////////////////////////// +// Function: PStatGraph::GuideBar::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +PStatGraph::GuideBar:: +GuideBar(double height, const string &label, bool is_target) : + _height(height), + _label(label), + _is_target(is_target) +{ +} + +//////////////////////////////////////////////////////////////////// +// Function: PStatGraph::GuideBar::Copy Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +PStatGraph::GuideBar:: +GuideBar(const PStatGraph::GuideBar ©) : + _height(copy._height), + _label(copy._label), + _is_target(copy._is_target) +{ +} + //////////////////////////////////////////////////////////////////// // Function: PStatGraph::Constructor // Access: Public @@ -65,7 +91,7 @@ get_num_guide_bars() const { const PStatGraph::GuideBar &PStatGraph:: get_guide_bar(int n) const { #ifndef NDEBUG - static GuideBar bogus_bar = { 0.0, "bogus", false }; + static GuideBar bogus_bar(0.0, "bogus", false); nassertr(n >= 0 && n < _guide_bars.size(), bogus_bar); #endif return _guide_bars[n]; @@ -171,9 +197,6 @@ make_guide_bar(double time) const { } } - GuideBar bar; - bar._height = time; - bar._label = label; - bar._is_target = (IS_NEARLY_EQUAL(1.0 / time, _target_frame_rate)); - return bar; + return GuideBar(time, label, + IS_NEARLY_EQUAL(1.0 / time, _target_frame_rate)); } diff --git a/pandatool/src/pstatserver/pStatGraph.h b/pandatool/src/pstatserver/pStatGraph.h index 5aae1e440a..c3f90b8656 100644 --- a/pandatool/src/pstatserver/pStatGraph.h +++ b/pandatool/src/pstatserver/pStatGraph.h @@ -44,6 +44,9 @@ public: class GuideBar { public: + GuideBar(double height, const string &label, bool is_target); + GuideBar(const GuideBar ©); + double _height; string _label; bool _is_target; diff --git a/pandatool/src/pstatserver/pStatReader.cxx b/pandatool/src/pstatserver/pStatReader.cxx index 6abbacdf65..aff96e4c53 100644 --- a/pandatool/src/pstatserver/pStatReader.cxx +++ b/pandatool/src/pstatserver/pStatReader.cxx @@ -12,6 +12,7 @@ #include #include #include +#include //////////////////////////////////////////////////////////////////// // Function: PStatReader::Constructor @@ -118,10 +119,8 @@ idle() { string PStatReader:: get_hostname() { if (_hostname.empty()) { - char temp_buff[1024]; - if (gethostname(temp_buff, 1024) == 0) { - _hostname = temp_buff; - } else { + _hostname = ConnectionManager::get_host_name(); + if (_hostname.empty()) { _hostname = "unknown"; } } diff --git a/pandatool/src/stitch/Sources.pp b/pandatool/src/stitch/Sources.pp index 68b0ab985f..b5c98abeba 100644 --- a/pandatool/src/stitch/Sources.pp +++ b/pandatool/src/stitch/Sources.pp @@ -2,6 +2,8 @@ #define TARGET stitch-command #define LOCAL_LIBS \ stitchbase progbase + #define OTHER_LIBS \ + linmath:c putil:c express:c panda:m pandaexpress:m pystub dtool #define SOURCES \ stitchCommandProgram.cxx stitchCommandProgram.h @@ -14,6 +16,8 @@ #define TARGET stitch-image #define LOCAL_LIBS \ stitchbase progbase + #define OTHER_LIBS \ + linmath:c putil:c express:c panda:m pandaexpress:m pystub dtool #define SOURCES \ stitchImageProgram.cxx stitchImageProgram.h @@ -27,8 +31,8 @@ #define OTHER_LIBS \ device:c tform:c graph:c dgraph:c sgraph:c gobj:c sgattrib:c \ event:c chancfg:c display:c sgraphutil:c light:c putil:c express:c \ - panda:m \ - dtoolutil:c dconfig:c dtool:m + panda:m pandaexpress:m \ + dtoolutil:c dconfig:c dtool:m pystub #define SOURCES \ stitchViewerProgram.cxx stitchViewerProgram.h diff --git a/pandatool/src/stitchbase/Sources.pp b/pandatool/src/stitchbase/Sources.pp index e944364824..7898b27c69 100644 --- a/pandatool/src/stitchbase/Sources.pp +++ b/pandatool/src/stitchbase/Sources.pp @@ -1,7 +1,7 @@ #define YACC_PREFIX stitchyy #define LFLAGS -i -#begin lib_target +#begin ss_lib_target #define TARGET stitchbase #define LOCAL_LIBS \ progbase @@ -35,4 +35,4 @@ stitchParserDefs.h stitchPerspectiveLens.h stitchPoint.h \ stitcher.h triangle.h triangleRasterizer.h -#end lib_target +#end ss_lib_target diff --git a/pandatool/src/stitchbase/config_stitch.h b/pandatool/src/stitchbase/config_stitch.h index 4901ed8bcd..d0c1d905f4 100644 --- a/pandatool/src/stitchbase/config_stitch.h +++ b/pandatool/src/stitchbase/config_stitch.h @@ -6,9 +6,7 @@ #ifndef CONFIG_STITCH_H #define CONFIG_STITCH_H -#include - -using namespace std; +#include extern string chan_cfg; diff --git a/pandatool/src/stitchbase/layeredImage.cxx b/pandatool/src/stitchbase/layeredImage.cxx index b90dd19b71..5302549b67 100644 --- a/pandatool/src/stitchbase/layeredImage.cxx +++ b/pandatool/src/stitchbase/layeredImage.cxx @@ -6,9 +6,9 @@ #include "layeredImage.h" #include -#include +#include + #include -#include // Constants taken from various header files in Gimp. #define TILE_WIDTH 64 @@ -287,13 +287,13 @@ xcf_write_int8(const int8_t *data, int num) { int LayeredImage:: xcf_write_int32(const int32_t *data, int num) { - int32_t *tmp = new int32_t[num]; + // We need to write a bunch of big-endian int32's. + Datagram dg; for (int i = 0; i < num; i++) { - tmp[i] = htonl(data[i]); + dg.add_be_int32(data[i]); } - _out->write((const char *)tmp, num * sizeof(int32_t)); - delete[] tmp; - return _pos += num * sizeof(int32_t); + _out->write((const char *)dg.get_data(), dg.get_length()); + return _pos += dg.get_length(); } int LayeredImage:: diff --git a/pandatool/src/stitchbase/morphGrid.cxx b/pandatool/src/stitchbase/morphGrid.cxx index 4d920950cf..b0219c9889 100644 --- a/pandatool/src/stitchbase/morphGrid.cxx +++ b/pandatool/src/stitchbase/morphGrid.cxx @@ -9,6 +9,7 @@ #include #include +#include MorphGrid::Vertex:: Vertex(const LPoint2d &p) { diff --git a/pandatool/src/stitchbase/morphGrid.h b/pandatool/src/stitchbase/morphGrid.h index 180ca3b199..7bd4a45f58 100644 --- a/pandatool/src/stitchbase/morphGrid.h +++ b/pandatool/src/stitchbase/morphGrid.h @@ -95,6 +95,7 @@ private: }; TriangleTree *_tree; + friend class TriangleTree; }; #endif diff --git a/pandatool/src/stitchbase/stitchFile.cxx b/pandatool/src/stitchbase/stitchFile.cxx index 830c2e48ef..a4548fe634 100644 --- a/pandatool/src/stitchbase/stitchFile.cxx +++ b/pandatool/src/stitchbase/stitchFile.cxx @@ -9,8 +9,6 @@ #include "stitchParserDefs.h" #include "stitchLexerDefs.h" -#include - StitchFile:: StitchFile() { } diff --git a/pandatool/src/stitchbase/stitchLexer.lxx b/pandatool/src/stitchbase/stitchLexer.lxx index 74ec0014af..1835124052 100644 --- a/pandatool/src/stitchbase/stitchLexer.lxx +++ b/pandatool/src/stitchbase/stitchLexer.lxx @@ -93,10 +93,8 @@ stitchyyerror(const string &msg) { } void -stitchyyerror(ostrstream &strm) { - char *s = strm.str(); - stitchyyerror(s); - delete[] s; +stitchyyerror(ostringstream &strm) { + stitchyyerror(strm.str()); } void @@ -110,10 +108,8 @@ stitchyywarning(const string &msg) { } void -stitchyywarning(ostrstream &strm) { - char *s = strm.str(); - stitchyywarning(s); - delete[] s; +stitchyywarning(ostringstream &strm) { + stitchyywarning(strm); } // Now define a function to take input from an istream instead of a @@ -216,10 +212,9 @@ eat_c_comment() { c = read_char(line, col); while (c != EOF && !(last_c == '*' && c == '/')) { if (last_c == '/' && c == '*') { - ostrstream errmsg; + ostringstream errmsg; errmsg << "This comment contains a nested /* symbol at line " - << line << ", column " << col-1 << "--possibly unclosed?" - << ends; + << line << ", column " << col-1 << "--possibly unclosed?"; stitchyywarning(errmsg); } last_c = c; diff --git a/pandatool/src/stitchbase/stitchLexerDefs.h b/pandatool/src/stitchbase/stitchLexerDefs.h index 6b7436ae2d..c4e2b630d1 100644 --- a/pandatool/src/stitchbase/stitchLexerDefs.h +++ b/pandatool/src/stitchbase/stitchLexerDefs.h @@ -13,10 +13,10 @@ int stitch_error_count(); int stitch_warning_count(); void stitchyyerror(const string &msg); -void stitchyyerror(ostrstream &strm); +void stitchyyerror(ostringstream &strm); void stitchyywarning(const string &msg); -void stitchyywarning(ostrstream &strm); +void stitchyywarning(ostringstream &strm); int stitchyylex(); diff --git a/pandatool/src/stitchviewer/Sources.pp b/pandatool/src/stitchviewer/Sources.pp index aee8c4a690..0e96cbbd4f 100644 --- a/pandatool/src/stitchviewer/Sources.pp +++ b/pandatool/src/stitchviewer/Sources.pp @@ -1,4 +1,4 @@ -#begin lib_target +#begin ss_lib_target #define TARGET stitchviewer #define LOCAL_LIBS \ stitchbase @@ -15,5 +15,5 @@ #define INSTALL_HEADERS \ stitchImageConverter.h stitchImageVisualizer.h triangleMesh.h -#end lib_target +#end ss_lib_target diff --git a/pandatool/src/stitchviewer/triangleMesh.h b/pandatool/src/stitchviewer/triangleMesh.h index da3f506627..59776c5b93 100644 --- a/pandatool/src/stitchviewer/triangleMesh.h +++ b/pandatool/src/stitchviewer/triangleMesh.h @@ -7,7 +7,10 @@ #define TRIANGLEMESH_H #include -#include +#include +#include +#include +#include class GeomTristrip; @@ -21,10 +24,10 @@ public: GeomTristrip *build_mesh() const; - PTA(Vertexf) _coords; - PTA(Normalf) _norms; - PTA(Colorf) _colors; - PTA(TexCoordf) _texcoords; + PTA_Vertexf _coords; + PTA_Normalf _norms; + PTA_Colorf _colors; + PTA_TexCoordf _texcoords; private: int _x_verts, _y_verts; diff --git a/pandatool/src/text-stats/Sources.pp b/pandatool/src/text-stats/Sources.pp index 8bed0cfa19..f01a292af8 100644 --- a/pandatool/src/text-stats/Sources.pp +++ b/pandatool/src/text-stats/Sources.pp @@ -6,8 +6,8 @@ #define LOCAL_LIBS \ progbase pstatserver #define OTHER_LIBS \ - pstatclient:c linmath:c putil:c express:c panda:m \ - dtoolutil:c dconfig:c dtool:m + pstatclient:c linmath:c putil:c express:c panda:m pandaexpress:m \ + dtoolutil:c dconfig:c dtool:m pystub #define UNIX_SYS_LIBS \ m