1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

GCS: Get rid of some compiler warnings.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@906 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
ephy 2010-06-27 15:06:57 +00:00 committed by ephy
parent 694f7e7feb
commit 4b9f224674
18 changed files with 29 additions and 18 deletions

View File

@ -250,7 +250,7 @@ PQP_Model::MemUsage(int msg)
if (msg) if (msg)
{ {
fprintf(stderr,"Total for model %x: %d bytes\n", this, total_mem); fprintf(stderr,"Total for model %p: %d bytes\n", this, total_mem);
fprintf(stderr,"BVs: %d alloced, take %d bytes each\n", fprintf(stderr,"BVs: %d alloced, take %d bytes each\n",
num_bvs, sizeof(BV)); num_bvs, sizeof(BV));
fprintf(stderr,"Tris: %d alloced, take %d bytes each\n", fprintf(stderr,"Tris: %d alloced, take %d bytes each\n",

View File

@ -58,7 +58,7 @@ static void
lib3ds_chunk_debug_dump(Lib3dsChunk *c) lib3ds_chunk_debug_dump(Lib3dsChunk *c)
{ {
if (enable_dump) { if (enable_dump) {
printf("%s%s (0x%X) size=%lu\n", printf("%s%s (0x%X) size=%d\n",
lib3ds_chunk_level, lib3ds_chunk_level,
lib3ds_chunk_name(c->chunk), lib3ds_chunk_name(c->chunk),
c->chunk, c->chunk,

View File

@ -1963,6 +1963,13 @@ file_bounding_box_of_nodes_impl(Lib3dsNode *node, Lib3dsFile *file, Lib3dsBool i
} }
break; break;
*/ */
case LIB3DS_UNKNOWN_NODE:
case LIB3DS_AMBIENT_NODE:
case LIB3DS_CAMERA_NODE:
case LIB3DS_TARGET_NODE:
case LIB3DS_LIGHT_NODE:
case LIB3DS_SPOT_NODE:
break;
} }
{ {
Lib3dsNode *p=node->childs; Lib3dsNode *p=node->childs;

View File

@ -30,7 +30,7 @@
/*! /*!
* \defgroup light Lights * \defgroup light Lights
*/ */
/*! /*!*/
/*! /*!

View File

@ -568,7 +568,7 @@ lib3ds_mesh_dump(Lib3dsMesh *mesh)
Lib3dsVector p; Lib3dsVector p;
ASSERT(mesh); ASSERT(mesh);
printf(" %s vertices=%ld faces=%ld\n", printf(" %s vertices=%d faces=%d\n",
mesh->name, mesh->name,
mesh->points, mesh->points,
mesh->faces mesh->faces

View File

@ -1548,5 +1548,7 @@ lib3ds_dump_tracks(Lib3dsNode *node)
printf("pos: "); printf("pos: ");
lib3ds_lin3Track_dump(&node->data.spot.pos_track); lib3ds_lin3Track_dump(&node->data.spot.pos_track);
break; break;
case LIB3DS_UNKNOWN_NODE:
break;
} }
} }

View File

@ -380,7 +380,7 @@ lib3ds_viewport_dump(Lib3dsViewport *vp)
printf(" position: %d,%d\n", printf(" position: %d,%d\n",
vp->layout.position[0], vp->layout.position[1]); vp->layout.position[0], vp->layout.position[1]);
printf(" size: %d,%d\n", vp->layout.size[0], vp->layout.size[1]); printf(" size: %d,%d\n", vp->layout.size[0], vp->layout.size[1]);
printf(" views: %ld\n", vp->layout.views); printf(" views: %d\n", vp->layout.views);
if (vp->layout.views > 0 && vp->layout.viewL != NULL) { if (vp->layout.views > 0 && vp->layout.viewL != NULL) {
for(i=0, view=vp->layout.viewL; i < vp->layout.views; ++i, ++view) { for(i=0, view=vp->layout.viewL; i < vp->layout.views; ++i, ++view) {
printf(" view %d:\n", i); printf(" view %d:\n", i);

View File

@ -221,7 +221,7 @@ void GLC_RepTrackBallMover::computeRadius()
// Circle radius in OpenGL unit = Radius(Pixel) * (dimend GL / dimens Pixel) // Circle radius in OpenGL unit = Radius(Pixel) * (dimend GL / dimens Pixel)
const double RayonSph= fabs((static_cast<double>(nRayonSph) * ChampsVision / winVSize)); const double RayonSph= fabs((static_cast<double>(nRayonSph) * ChampsVision / winVSize));
if (not qFuzzyCompare(RayonSph, 0.0) and not qFuzzyCompare(RayonSph - m_Radius, 0.0) or (RayonSph < 2.0)) if (((not qFuzzyCompare(RayonSph, 0.0)) and (not qFuzzyCompare(RayonSph - m_Radius, 0.0))) or (RayonSph < 2.0))
{ {
// Main circle radius // Main circle radius
m_MainCircle.setRadius(RayonSph); m_MainCircle.setRadius(RayonSph);

View File

@ -51,7 +51,7 @@ namespace core {
private: private:
Cache(); Cache();
Cache(Cache const&){}; Cache(Cache const&){};
Cache& operator=(Cache const&){}; Cache& operator=(Cache const&){ return *this; };
static Cache* m_pInstance; static Cache* m_pInstance;
QString cache; QString cache;
QString routeCache; QString routeCache;

View File

@ -37,7 +37,7 @@ namespace core {
m_pInstance=new OPMaps; m_pInstance=new OPMaps;
return m_pInstance; return m_pInstance;
} }
OPMaps::OPMaps():useMemoryCache(true),MaxZoom(19),RetryLoadTile(2) OPMaps::OPMaps():MaxZoom(19),RetryLoadTile(2),useMemoryCache(true)
{ {
accessmode=AccessMode::ServerAndCache; accessmode=AccessMode::ServerAndCache;
Language=LanguageType::PortuguesePortugal; Language=LanguageType::PortuguesePortugal;
@ -194,14 +194,14 @@ namespace core {
#endif //DEBUG_GMAPS #endif //DEBUG_GMAPS
QTime time; QTime time;
time.start(); time.start();
while( !(reply->isFinished() | time.elapsed()>(6*Timeout)) ){QCoreApplication::processEvents(QEventLoop::AllEvents);} while( !(reply->isFinished() || (time.elapsed()>(6*Timeout))) ){QCoreApplication::processEvents(QEventLoop::AllEvents);}
#ifdef DEBUG_TIMINGS #ifdef DEBUG_TIMINGS
qDebug()<<"Network time:"<<time.elapsed(); qDebug()<<"Network time:"<<time.elapsed();
#endif #endif
#ifdef DEBUG_GMAPS #ifdef DEBUG_GMAPS
qDebug()<<"Finished?"<<reply->error()<<" abort?"<<(time.elapsed()>Timeout*6); qDebug()<<"Finished?"<<reply->error()<<" abort?"<<(time.elapsed()>Timeout*6);
#endif //DEBUG_GMAPS #endif //DEBUG_GMAPS
if( (reply->error()!=QNetworkReply::NoError) | (time.elapsed()>Timeout*6)) if( (reply->error()!=QNetworkReply::NoError) || (time.elapsed()>Timeout*6))
{ {
#ifdef DEBUG_GMAPS #ifdef DEBUG_GMAPS
qDebug()<<"Request timed out ";//<<pos.x+","+pos.y; qDebug()<<"Request timed out ";//<<pos.x+","+pos.y;

View File

@ -78,7 +78,7 @@ namespace core {
OPMaps(); OPMaps();
OPMaps(OPMaps const&){}; OPMaps(OPMaps const&){};
OPMaps& operator=(OPMaps const&){}; OPMaps& operator=(OPMaps const&){ return *this; }
static OPMaps* m_pInstance; static OPMaps* m_pInstance;

View File

@ -66,7 +66,7 @@ void RawTile::setZoom(const int &value)
uint qHash(RawTile const& tile) uint qHash(RawTile const& tile)
{ {
// RawTile tile=tilee; // RawTile tile=tilee;
quint64 tmp=(((quint64)(tile.zoom))<<54)+(((int)(tile.type))<<36)+(((quint64)(tile.pos.X()))<<18)+(((quint64)(tile.pos.Y()))); quint64 tmp=(((quint64)(tile.zoom))<<54)+(((quint64)(tile.type))<<36)+(((quint64)(tile.pos.X()))<<18)+(((quint64)(tile.pos.Y())));
// quint64 tmp5=tmp+tmp2+tmp3+tmp4; // quint64 tmp5=tmp+tmp2+tmp3+tmp4;
return ::qHash(tmp); return ::qHash(tmp);
} }

View File

@ -34,8 +34,8 @@ qlonglong internals::Core::debugcounter=0;
using namespace projections; using namespace projections;
namespace internals { namespace internals {
Core::Core():currentPosition(0,0),currentPositionPixel(0,0),LastLocationInBounds(-1,-1),sizeOfMapArea(0,0) Core::Core():MouseWheelZooming(false),currentPosition(0,0),currentPositionPixel(0,0),LastLocationInBounds(-1,-1),sizeOfMapArea(0,0)
,minOfTiles(0,0),maxOfTiles(0,0),isDragging(false),started(false),MouseWheelZooming(false),TooltipTextPadding(10,10),zoom(0),loaderLimit(5) ,minOfTiles(0,0),maxOfTiles(0,0),zoom(0),isDragging(false),TooltipTextPadding(10,10),loaderLimit(5),started(false)
{ {
mousewheelzoomtype=MouseWheelZoomType::MousePositionAndCenter; mousewheelzoomtype=MouseWheelZoomType::MousePositionAndCenter;
SetProjection(new MercatorProjection()); SetProjection(new MercatorProjection());

View File

@ -31,7 +31,7 @@
namespace projections { namespace projections {
MercatorProjectionYandex::MercatorProjectionYandex():MinLatitude(-85.05112878), MaxLatitude(85.05112878),MinLongitude(-177), MercatorProjectionYandex::MercatorProjectionYandex():MinLatitude(-85.05112878), MaxLatitude(85.05112878),MinLongitude(-177),
MaxLongitude(177), tileSize(256, 256),RAD_DEG(180 / M_PI),DEG_RAD(M_PI / 180), MathPiDiv4(M_PI / 4) MaxLongitude(177), RAD_DEG(180 / M_PI),DEG_RAD(M_PI / 180),MathPiDiv4(M_PI / 4),tileSize(256, 256)
{ {
} }
Point MercatorProjectionYandex::FromLatLngToPixel(double lat, double lng, const int &zoom) Point MercatorProjectionYandex::FromLatLngToPixel(double lat, double lng, const int &zoom)

View File

@ -17,6 +17,7 @@ class MapGraphicItem:public QObject,public QGraphicsItem
{ {
friend class mapcontrol::OPMapWidget; friend class mapcontrol::OPMapWidget;
Q_OBJECT Q_OBJECT
Q_INTERFACES(QGraphicsItem)
public: public:
MapGraphicItem(internals::Core *core,Configuration *configuration); MapGraphicItem(internals::Core *core,Configuration *configuration);
QRectF boundingRect() const; QRectF boundingRect() const;

View File

@ -217,7 +217,7 @@ void QwtDoubleRange::setStep(double vstep)
newStep = intv * DefaultRelStep; newStep = intv * DefaultRelStep;
else else
{ {
if ((intv > 0) && (vstep < 0) || (intv < 0) && (vstep > 0)) if (((intv > 0) && (vstep < 0)) || ((intv < 0) && (vstep > 0)))
newStep = -vstep; newStep = -vstep;
else else
newStep = vstep; newStep = vstep;

View File

@ -49,6 +49,7 @@ namespace Ui {
class WaypointItem : public QObject, public QGraphicsItem class WaypointItem : public QObject, public QGraphicsItem
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES(QGraphicsItem)
public: public:
WaypointItem(QString name = "", double latitude = 0, double longitude = 0, double height_feet = 0, int time_seconds = 0, int hold_seconds = 0); WaypointItem(QString name = "", double latitude = 0, double longitude = 0, double height_feet = 0, int time_seconds = 0, int hold_seconds = 0);

View File

@ -156,8 +156,8 @@ int pjrc_rawhid::open(int max, int vid, int pid, int usage_page, int usage)
if (parsed_usage_page && parsed_usage) break; if (parsed_usage_page && parsed_usage) break;
} }
if ((!parsed_usage_page) || (!parsed_usage) || if ((!parsed_usage_page) || (!parsed_usage) ||
(usage_page > 0 && parsed_usage_page != usage_page) || (usage_page > 0 && parsed_usage_page != (uint32_t)usage_page) ||
(usage > 0 && parsed_usage != usage)) { (usage > 0 && parsed_usage != (uint32_t)usage)) {
usb_release_interface(u, i); usb_release_interface(u, i);
continue; continue;
} }