diff options
| author | Giuseppe Baruffa <gbaruffa@users.noreply.github.com> | 2007-03-29 08:27:03 +0000 |
|---|---|---|
| committer | Giuseppe Baruffa <gbaruffa@users.noreply.github.com> | 2007-03-29 08:27:03 +0000 |
| commit | a1fe5809a4760ed2aa64951c596156f48fca393e (patch) | |
| tree | 68066e08142f30f5e9ad07e24f40d60f779b6bf3 /OPJViewer/source/imagmj2.cpp | |
| parent | 5a3c1ffe7d5b4269d073fa826cba94591c0c3ed5 (diff) | |
Some coding style adaptations for compiling the OPJViewer GUI under Linux. It compiles, but does not yet display images.
Diffstat (limited to 'OPJViewer/source/imagmj2.cpp')
| -rw-r--r-- | OPJViewer/source/imagmj2.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/OPJViewer/source/imagmj2.cpp b/OPJViewer/source/imagmj2.cpp index 1a8e1ffb..ad637aab 100644 --- a/OPJViewer/source/imagmj2.cpp +++ b/OPJViewer/source/imagmj2.cpp @@ -86,35 +86,29 @@ IMPLEMENT_DYNAMIC_CLASS(wxMJ2Handler,wxImageHandler) /* sample error callback expecting a FILE* client object */
void mj2_error_callback(const char *msg, void *client_data) {
- char m_msg[MAX_MESSAGE_LEN];
int message_len = strlen(msg) - 1;
if (msg[message_len] != '\n')
message_len = MAX_MESSAGE_LEN;
- sprintf(m_msg, "[ERROR] %.*s", message_len, msg);
wxMutexGuiEnter();
- wxLogMessage(m_msg);
+ wxLogMessage(wxT("[ERROR] %.*s"), message_len, msg);
wxMutexGuiLeave();
}
/* sample warning callback expecting a FILE* client object */
void mj2_warning_callback(const char *msg, void *client_data) {
- char m_msg[MAX_MESSAGE_LEN];
int message_len = strlen(msg) - 1;
if (msg[message_len] != '\n')
message_len = MAX_MESSAGE_LEN;
- sprintf(m_msg, "[WARNING] %.*s", message_len, msg);
wxMutexGuiEnter();
- wxLogMessage(m_msg);
+ wxLogMessage(wxT("[WARNING] %.*s"), message_len, msg);
wxMutexGuiLeave();
}
/* sample debug callback expecting no client object */
void mj2_info_callback(const char *msg, void *client_data) {
- char m_msg[MAX_MESSAGE_LEN];
int message_len = strlen(msg) - 1;
if (msg[message_len] != '\n')
message_len = MAX_MESSAGE_LEN;
- sprintf(m_msg, "[INFO] %.*s", message_len, msg);
wxMutexGuiEnter();
- wxLogMessage(m_msg);
+ wxLogMessage(wxT("[INFO] %.*s"), message_len, msg);
wxMutexGuiLeave();
}
@@ -396,6 +390,14 @@ int my_box_handler_function(my_j2boxtype boxtype, wxInputStream& stream, unsigned long int filepoint, unsigned long int filelimit, int level,
char *scansign, unsigned long int *scanpoint);
+#ifdef __WXMSW__
+typedef unsigned __int64 int8byte;
+#endif // __WXMSW__
+
+#ifdef __WXGTK__
+typedef unsigned long long int8byte;
+#endif // __WXGTK__
+
/* internal mini-search for a box signature */
int
my_jpeg2000parse(wxInputStream& stream, unsigned long int filepoint, unsigned long int filelimit, int level,
@@ -405,7 +407,7 @@ my_jpeg2000parse(wxInputStream& stream, unsigned long int filepoint, unsigned lo //int LBox_read;
char TBox[5] = "\0\0\0\0";
//int TBox_read;
- __int64 XLBox = 0x0000000000000000;
+ int8byte XLBox = 0x0000000000000000;
//int XLBox_read;
unsigned long int box_length = 0;
int last_box = 0, box_num = 0;
@@ -514,7 +516,7 @@ searchjp2c(wxInputStream& stream, unsigned long int fsize, int number) wxLogMessage(wxT("MJ2: not found"));
else {
- wxLogMessage(wxString::Format("MJ2: found at byte %d", scanpoint));
+ wxLogMessage(wxString::Format(wxT("MJ2: found at byte %d"), scanpoint));
};
|
