diff options
Diffstat (limited to 'linden/indra/llimagej2coj')
-rw-r--r-- | linden/indra/llimagej2coj/llimagej2coj.cpp | 25 | ||||
-rw-r--r-- | linden/indra/llimagej2coj/llimagej2coj.h | 3 |
2 files changed, 23 insertions, 5 deletions
diff --git a/linden/indra/llimagej2coj/llimagej2coj.cpp b/linden/indra/llimagej2coj/llimagej2coj.cpp index ef498db..ce7c203 100644 --- a/linden/indra/llimagej2coj/llimagej2coj.cpp +++ b/linden/indra/llimagej2coj/llimagej2coj.cpp | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -57,26 +58,42 @@ void fallbackDestroyLLImageJ2CImpl(LLImageJ2CImpl* impl) | |||
57 | impl = NULL; | 58 | impl = NULL; |
58 | } | 59 | } |
59 | 60 | ||
61 | // Return string from message, eliminating final \n if present | ||
62 | static std::string chomp(const char* msg) | ||
63 | { | ||
64 | // stomp trailing \n | ||
65 | std::string message = msg; | ||
66 | if (!message.empty()) | ||
67 | { | ||
68 | size_t last = message.size() - 1; | ||
69 | if (message[last] == '\n') | ||
70 | { | ||
71 | message.resize( last ); | ||
72 | } | ||
73 | } | ||
74 | return message; | ||
75 | } | ||
76 | |||
60 | /** | 77 | /** |
61 | sample error callback expecting a LLFILE* client object | 78 | sample error callback expecting a LLFILE* client object |
62 | */ | 79 | */ |
63 | void error_callback(const char* msg, void*) | 80 | void error_callback(const char* msg, void*) |
64 | { | 81 | { |
65 | lldebugs << "LLImageJ2CImpl error_callback: " << msg << llendl; | 82 | lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; |
66 | } | 83 | } |
67 | /** | 84 | /** |
68 | sample warning callback expecting a LLFILE* client object | 85 | sample warning callback expecting a LLFILE* client object |
69 | */ | 86 | */ |
70 | void warning_callback(const char* msg, void*) | 87 | void warning_callback(const char* msg, void*) |
71 | { | 88 | { |
72 | lldebugs << "LLImageJ2CImpl warning_callback: " << msg << llendl; | 89 | lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; |
73 | } | 90 | } |
74 | /** | 91 | /** |
75 | sample debug callback expecting no client object | 92 | sample debug callback expecting no client object |
76 | */ | 93 | */ |
77 | void info_callback(const char* msg, void*) | 94 | void info_callback(const char* msg, void*) |
78 | { | 95 | { |
79 | lldebugs << "LLImageJ2CImpl info_callback: " << msg << llendl; | 96 | lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl; |
80 | } | 97 | } |
81 | 98 | ||
82 | 99 | ||
diff --git a/linden/indra/llimagej2coj/llimagej2coj.h b/linden/indra/llimagej2coj/llimagej2coj.h index 05504d6..73cb074 100644 --- a/linden/indra/llimagej2coj/llimagej2coj.h +++ b/linden/indra/llimagej2coj/llimagej2coj.h | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |