~ubuntu-branches/debian/jessie/stellarium/jessie

« back to all changes in this revision

Viewing changes to src/core/modules/ZoneArray.cpp

  • Committer: Package Import Robot
  • Author(s): Tomasz Buchert
  • Date: 2013-08-04 15:06:55 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20130804150655-iji0vb5navh3lk13
Tags: 0.12.2-1
* Imported Upstream version 0.12.2
* Added dependency to phonon (to enable video/sound)
* Fixed VCS links
* Removed unused lintian tag (embedded-library glee)
* Dropped obsolete patch
* Update copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include <QDebug>
21
21
#include <QFile>
 
22
#include <QDir>
22
23
#ifdef Q_OS_WIN
23
24
#include <io.h>
24
25
#include <windows.h>
83
84
}
84
85
 
85
86
#if (!defined(__GNUC__))
 
87
#ifndef _MSC_BUILD
86
88
#warning Star catalogue loading has only been tested with gcc
87
89
#endif
 
90
#endif
88
91
 
89
92
ZoneArray* ZoneArray::create(const QString& catalogFilePath, bool use_mmap)
90
93
{
92
95
        QFile* file = new QFile(catalogFilePath);
93
96
        if (!file->open(QIODevice::ReadOnly))
94
97
        {
95
 
                qWarning() << "Error while loading " << catalogFilePath << ": failed to open file.";
 
98
                qWarning() << "Error while loading " << QDir::toNativeSeparators(catalogFilePath) << ": failed to open file.";
96
99
                return 0;
97
100
        }
98
 
        dbStr = "Loading \"" + catalogFilePath + "\": ";
 
101
        dbStr = "Loading \"" + QDir::toNativeSeparators(catalogFilePath) + "\": ";
99
102
        unsigned int magic,major,minor,type,level,mag_min,mag_range,mag_steps;
100
103
        if (ReadInt(*file,magic) < 0 ||
101
104
                        ReadInt(*file,type) < 0 ||
138
141
        else if (magic == FILE_MAGIC)
139
142
        {
140
143
                // ok, FILE_MAGIC
141
 
#if (!defined(__GNUC__))
 
144
#if (!defined(__GNUC__) && !defined(_MSC_BUILD))
142
145
                if (use_mmap)
143
146
                {
144
147
                        // mmap only with gcc:
145
 
                        dbStr += "warning - you must convert catalogue "
146
 
                                  += "to native format before mmap loading";
 
148
                        dbStr += "warning - you must convert catalogue to native format before mmap loading";
147
149
                        qDebug(qPrintable(dbStr));
148
150
 
149
151
                        return 0;
195
197
                        // for your compiler.
196
198
                        // Because your compiler does not pack the data,
197
199
                        // which is crucial for this application.
 
200
#ifndef _MSC_BUILD
198
201
                        Q_ASSERT(sizeof(Star2) == 10);
 
202
#endif
199
203
                        rval = new SpecialZoneArray<Star2>(file, byte_swap, use_mmap, level, mag_min, mag_range, mag_steps);
200
204
                        if (rval == 0)
201
205
                        {
214
218
                        // for your compiler.
215
219
                        // Because your compiler does not pack the data,
216
220
                        // which is crucial for this application.
 
221
#ifndef _MSC_BUILD
217
222
                        Q_ASSERT(sizeof(Star3) == 6);
 
223
#endif
218
224
                        rval = new SpecialZoneArray<Star3>(file, byte_swap, use_mmap, level, mag_min, mag_range, mag_steps);
219
225
                        if (rval == 0)
220
226
                        {