From 0f391f3fb5804b87bbe8ca7655a7bbdb9f1e0c85 Mon Sep 17 00:00:00 2001 From: mdelfede Date: Sat, 7 Jun 2008 22:57:08 +0000 Subject: [PATCH] new uvs2 releases : uppsrc-2586 tutorial-38 examples-141 reference-113 git-svn-id: svn://ultimatepp.org/upp/trunk@283 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/AString.hpp | 56 +++++++ uppsrc/Core/Algo.h | 8 +- uppsrc/Core/Callback.h | 24 +-- uppsrc/Core/Path.h | 2 +- uppsrc/Core/String.h | 4 + uppsrc/Core/Util.cpp | 2 + uppsrc/Core/src.tpp/Stream$en-us.tpp | 1 - uppsrc/Core/src.tpp/algo$en-us.tpp | 1 - uppsrc/Core/srcdoc.tpp/BRC$en-us.tpp | 1 + uppsrc/Core/srcdoc.tpp/Translating$en-us.tpp | 1 + uppsrc/Core/z.h | 4 +- uppsrc/CtrlCore/TopWindow.cpp | 2 +- uppsrc/CtrlCore/TopWindow.h | 4 +- uppsrc/CtrlLib/ChWin32.cpp | 2 +- uppsrc/CtrlLib/ColumnList.cpp | 8 +- uppsrc/CtrlLib/ColumnList.h | 1 + uppsrc/CtrlLib/Ctrl.lay | 1 + uppsrc/CtrlLib/CtrlLib.upp | 1 - uppsrc/CtrlLib/DropChoice.h | 4 +- uppsrc/CtrlLib/EditCtrl.h | 2 +- uppsrc/CtrlLib/FileList.cpp | 2 +- uppsrc/CtrlLib/SliderCtrl.h | 3 +- uppsrc/CtrlLib/ToolButton.cpp | 2 +- uppsrc/CtrlLib/src.tpp/TextCtrl$en-us.tpp | 1 + uppsrc/Draw/Draw.h | 4 +- uppsrc/Draw/ImageOp.h | 4 +- uppsrc/GLCtrl/GLCtrl.h | 50 +++--- uppsrc/GLCtrl/GLCtrl.upp | 1 + uppsrc/GLCtrl/X11GLCtrl.cpp | 24 +-- uppsrc/PdfDraw/PdfDraw.h | 4 +- uppsrc/RichEdit/RichEdit.lay | 1 + uppsrc/RichText/Para.h | 2 +- uppsrc/Sql/Sqls.h | 2 +- uppsrc/Sql/sch_header.h | 4 +- uppsrc/Web/socket.cpp | 38 +++++ uppsrc/Web/socket.h | 1 + uppsrc/XmlView/XmlView.upp | 1 + uppsrc/XmlView/main.cpp | 2 +- uppsrc/ide/Browser/Browser.h | 4 +- uppsrc/ide/Common/Common.h | 4 +- uppsrc/ide/FormatCode.cpp | 2 +- uppsrc/ide/Install.cpp | 8 +- uppsrc/ide/LayDes/laywin.cpp | 2 +- uppsrc/ide/app.tpp/About$en-us.tpp | 1 - uppsrc/ide/app.tpp/Sponsor$en-us.tpp | 1 - uppsrc/ide/app.tpp/index$en-us.tpp | 1 - uppsrc/plugin/astyle/ASFormatter.cpp | 10 +- uppsrc/plugin/astyle/ASStringTools.cpp | 8 +- uppsrc/plugin/astyle/ASStringTools.hpp | 2 +- uppsrc/plugin/astyle/astyle.h | 3 +- uppsrc/plugin/astyle/astyle.upp | 1 + uppsrc/plugin/pcx/pcx.upp | 1 + uppsrc/plugin/pcx/pcxhdr.h | 2 +- uppsrc/plugin/tif/lib/HOWTO-RELEASE | 16 +- uppsrc/plugin/tif/lib/Makefile.am | 17 +- uppsrc/plugin/tif/lib/Makefile.in | 24 +-- uppsrc/plugin/tif/lib/Makefile.vc | 18 +- uppsrc/plugin/tif/lib/SConstruct | 16 +- uppsrc/plugin/tif/lib/tif_apple.c | 18 +- uppsrc/plugin/tif/lib/tif_atari.c | 16 +- uppsrc/plugin/tif/lib/tif_aux.c | 20 +-- uppsrc/plugin/tif/lib/tif_close.c | 35 ++-- uppsrc/plugin/tif/lib/tif_codec.c | 23 +-- uppsrc/plugin/tif/lib/tif_color.c | 28 ++-- uppsrc/plugin/tif/lib/tif_compress.c | 22 +-- uppsrc/plugin/tif/lib/tif_dir.c | 48 +++--- uppsrc/plugin/tif/lib/tif_dir.h | 24 +-- uppsrc/plugin/tif/lib/tif_dirinfo.c | 168 +++++++++---------- uppsrc/plugin/tif/lib/tif_dirread.c | 48 +++--- uppsrc/plugin/tif/lib/tif_dirwrite.c | 60 +++---- uppsrc/plugin/tif/lib/tif_dumpmode.c | 18 +- uppsrc/plugin/tif/lib/tif_error.c | 17 +- uppsrc/plugin/tif/lib/tif_fax3.c | 28 ++-- uppsrc/plugin/tif/lib/tif_fax3.h | 16 +- uppsrc/plugin/tif/lib/tif_getimage.c | 160 +++++++++--------- uppsrc/plugin/tif/lib/tif_jpeg.c | 98 +++++------ uppsrc/plugin/tif/lib/tif_luv.c | 20 +-- uppsrc/plugin/tif/lib/tif_lzw.c | 36 ++-- uppsrc/plugin/tif/lib/tif_msdos.c | 18 +- uppsrc/plugin/tif/lib/tif_next.c | 16 +- uppsrc/plugin/tif/lib/tif_ojpeg.c | 26 +-- uppsrc/plugin/tif/lib/tif_open.c | 26 +-- uppsrc/plugin/tif/lib/tif_packbits.c | 18 +- uppsrc/plugin/tif/lib/tif_pixarlog.c | 60 +++---- uppsrc/plugin/tif/lib/tif_predict.c | 18 +- uppsrc/plugin/tif/lib/tif_predict.h | 16 +- uppsrc/plugin/tif/lib/tif_print.c | 26 +-- uppsrc/plugin/tif/lib/tif_read.c | 24 +-- uppsrc/plugin/tif/lib/tif_stream.cxx | 20 +-- uppsrc/plugin/tif/lib/tif_strip.c | 26 +-- uppsrc/plugin/tif/lib/tif_swab.c | 80 ++++----- uppsrc/plugin/tif/lib/tif_thunder.c | 18 +- uppsrc/plugin/tif/lib/tif_tile.c | 26 +-- uppsrc/plugin/tif/lib/tif_unix.c | 32 ++-- uppsrc/plugin/tif/lib/tif_warning.c | 18 +- uppsrc/plugin/tif/lib/tif_win3.c | 18 +- uppsrc/plugin/tif/lib/tif_win32.c | 22 +-- uppsrc/plugin/tif/lib/tif_write.c | 32 ++-- uppsrc/plugin/tif/lib/tif_zip.c | 16 +- uppsrc/plugin/tif/lib/tiff.h | 24 +-- uppsrc/plugin/tif/lib/tiffio.h | 28 ++-- uppsrc/plugin/tif/lib/tiffiop.h | 22 +-- uppsrc/plugin/zip/zip.h | 16 +- uppsrc/plugin/zip/zip.upp | 1 + 104 files changed, 1043 insertions(+), 923 deletions(-) diff --git a/uppsrc/Core/AString.hpp b/uppsrc/Core/AString.hpp index 4b18ef8c8..ae11b47e6 100644 --- a/uppsrc/Core/AString.hpp +++ b/uppsrc/Core/AString.hpp @@ -106,6 +106,62 @@ int AString::Find(const tchar *s, int from) const return Find(strlen__(s), s, from); } +template +int AString::FindFirstOf(int len, const tchar *s, int from) const +{ + ASSERT(from >= 0 && from <= GetLength()); + const tchar *ptr = B::Begin(); + const tchar *e = End(); + const tchar *se = s + (len * sizeof(tchar)); + if((s[0] & s[1]) != 0) { + if(s[2] == 0) { + __BREAK__; + tchar c1 = s[0]; + tchar c2 = s[1]; + for(const tchar *bs = ptr + from; bs < e; bs++) { + tchar ch = *bs; + if(ch == c1 || ch == c2) + return (int)(bs - ptr); + } + return -1; + } + if(s[3] == 0) { + tchar c1 = s[0]; + tchar c2 = s[1]; + tchar c3 = s[2]; + for(const tchar *bs = ptr + from; bs < e; bs++) { + tchar ch = *bs; + if(ch == c1 || ch == c2 || ch == c3) + return (int)(bs - ptr); + } + return -1; + } + if(s[4] == 0) { + tchar c1 = s[0]; + tchar c2 = s[1]; + tchar c3 = s[2]; + tchar c4 = s[3]; + for(const tchar *bs = ptr + from; bs < e; bs++) { + tchar ch = *bs; + if(ch == c1 || ch == c2 || ch == c3 || ch == c4) + return (int)(bs - ptr); + } + return -1; + } + } + for(const tchar *bs = ptr + from; bs < e; bs++) + for(const tchar *ss = s; ss < se; ss++) + if(*bs == *ss) + return (int)(bs - ptr); + return -1; +} + +template +int AString::FindFirstOf(const tchar *s, int from) const +{ + return FindFirstOf(strlen__(s), s, from); +} + inline int String0::Compare(const String0& s) const { #ifdef FAST_STRING_COMPARE diff --git a/uppsrc/Core/Algo.h b/uppsrc/Core/Algo.h index 85a79e127..76258052d 100644 --- a/uppsrc/Core/Algo.h +++ b/uppsrc/Core/Algo.h @@ -855,7 +855,7 @@ template struct StableSortItem { const T& value; int index; - + StableSortItem(const T& value, int index) : value(value), index(index) {} }; @@ -863,7 +863,7 @@ template struct StableSortIterator { II ii; int *vi; - + typedef StableSortIterator Iter; Iter& operator ++ () { ++ii; ++vi; return *this; } @@ -890,7 +890,7 @@ struct StableSortLess_ { if(less(a.value, b.value)) return true; return less(b.value, a.value) ? false : a.index < b.index; } - + StableSortLess_(const Less& less) : less(less) {} }; @@ -932,7 +932,7 @@ struct StableSortLessCmp_ { int q = SgnCompare(a.value, b.value); return q ? q < 0 : a.index < b.index; } - + StableSortLessCmp_(const Cmp& cmp) : cmp(cmp) {} }; diff --git a/uppsrc/Core/Callback.h b/uppsrc/Core/Callback.h index 3a2c84541..785245b90 100644 --- a/uppsrc/Core/Callback.h +++ b/uppsrc/Core/Callback.h @@ -223,28 +223,28 @@ Callback pteback3(Object *object, R (O::*method)(A, B, C), T1 arg1, T2 arg2, T3 } template -struct CallbackMethodActionArg3 : public CallbackAction +struct CallbackMethodActionArg3 : public CallbackAction { OBJECT_ *object; METHOD_ method; T1 arg1; T2 arg2; T3 arg3; - + void Execute() { (object->*method)(arg1, arg2, arg3); } CallbackMethodActionArg3(OBJECT_ *object, METHOD_ method, T1 arg1, T2 arg2, T3 arg3) : object(object), method(method), arg1(arg1), arg2(arg2), arg3(arg3) {} }; -template -Callback callback3(Object *object, R (O::*method)(A, B, C), T1 arg1, T2 arg2, T3 arg3) +template +Callback callback3(Object *object, R (O::*method)(A, B, C), T1 arg1, T2 arg2, T3 arg3) { return Callback( new CallbackMethodActionArg3(object, method, arg1, arg2, arg3)); } -template +template Callback callback3(const Object *object, R (O::*method)(A, B, C) const, T1 arg1, T2 arg2, T3 arg3) { return Callback(new CallbackMethodActionArg3 (object, method, arg1, arg2, arg3)); @@ -258,7 +258,7 @@ struct CallbackActionCallArg3 : public CallbackAction { T3 arg3; void Execute() { x(arg1, arg2, arg3); } - CallbackActionCallArg3(X x, T1 arg1, T2 arg2, T3 arg3) + CallbackActionCallArg3(X x, T1 arg1, T2 arg2, T3 arg3) : x(x), arg1(arg1), arg2(arg2), arg3(arg3) {} }; @@ -295,7 +295,7 @@ Callback pteback4(Object *object, R (O::*method)(A, B,C,D), T1 arg1, T2 arg2, T3 } template -struct CallbackMethodActionArg4 : public CallbackAction +struct CallbackMethodActionArg4 : public CallbackAction { OBJECT_ *object; METHOD_ method; @@ -303,21 +303,21 @@ struct CallbackMethodActionArg4 : public CallbackAction T2 arg2; T3 arg3; T4 arg4; - + void Execute() { (object->*method)(arg1, arg2, arg3, arg4); } CallbackMethodActionArg4(OBJECT_ *object, METHOD_ method, T1 arg1, T2 arg2, T3 arg3, T4 arg4) : object(object), method(method), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4) {} }; -template -Callback callback4(Object *object, R (O::*method)(A, B, C, D), T1 arg1, T2 arg2, T3 arg3, T4 arg4) +template +Callback callback4(Object *object, R (O::*method)(A, B, C, D), T1 arg1, T2 arg2, T3 arg3, T4 arg4) { return Callback( new CallbackMethodActionArg4(object, method, arg1, arg2, arg3, arg4)); } -template +template Callback callback4(const Object *object, R (O::*method)(A, B, C, D) const, T1 arg1, T2 arg2, T3 arg3, T4 arg4) { return Callback(new CallbackMethodActionArg4 (object, method, arg1, arg2, arg3, arg4)); @@ -332,7 +332,7 @@ struct CallbackActionCallArg4 : public CallbackAction { T4 arg4; void Execute() { x(arg1, arg2, arg3, arg4); } - CallbackActionCallArg4(X x, T1 arg1, T2 arg2, T3 arg3, T4 arg4) + CallbackActionCallArg4(X x, T1 arg1, T2 arg2, T3 arg3, T4 arg4) : x(x), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4) {} }; diff --git a/uppsrc/Core/Path.h b/uppsrc/Core/Path.h index f4ec5913a..dc3ad9a21 100644 --- a/uppsrc/Core/Path.h +++ b/uppsrc/Core/Path.h @@ -257,7 +257,7 @@ public: virtual bool CreateFolder(String path, String& error) const; bool FolderExists(String path) const; - + virtual ~FileSystemInfo() {} }; diff --git a/uppsrc/Core/String.h b/uppsrc/Core/String.h index 1f8ad1bea..693a475e9 100644 --- a/uppsrc/Core/String.h +++ b/uppsrc/Core/String.h @@ -95,6 +95,10 @@ public: bool EndsWith(const tchar *s) const { return EndsWith(s, strlen__(s)); } bool EndsWith(const String& s) const { return EndsWith(~s, s.GetLength()); } + int FindFirstOf(int len, const tchar *s, int from) const; + int FindFirstOf(const tchar *s, int from = 0) const; + int FindFirstOf(const String& s, int from = 0) const { return FindFirstOf(s.GetCount(), ~s, from); } + friend bool operator<(const String& a, const String& b) { return a.Compare(b) < 0; } friend bool operator<(const String& a, const tchar *b) { return a.Compare(b) < 0; } friend bool operator<(const tchar *a, const String& b) { return b.Compare(a) > 0; } diff --git a/uppsrc/Core/Util.cpp b/uppsrc/Core/Util.cpp index d039d45af..07a35c77d 100644 --- a/uppsrc/Core/Util.cpp +++ b/uppsrc/Core/Util.cpp @@ -62,7 +62,9 @@ void Panic(const char *msg) # endif #else #endif +#ifdef _DEBUG __BREAK__; +#endif abort(); } diff --git a/uppsrc/Core/src.tpp/Stream$en-us.tpp b/uppsrc/Core/src.tpp/Stream$en-us.tpp index faffaec39..73c34c946 100644 --- a/uppsrc/Core/src.tpp/Stream$en-us.tpp +++ b/uppsrc/Core/src.tpp/Stream$en-us.tpp @@ -30,4 +30,3 @@ COMPRESSED 247,35,184,55,19,97,81,151,225,169,214,239,39,186,131,134,95,22,4,233,52,87,210,105,90,232,32,98,159,242,144,231,17,117,39,171,6,179,58,246,162,64,245,22,23,255,78,200,81,14,38,222,61,27,239,73,118,81,201,131,91,239,173,62,251,251,56,205,23,0,83,63,86,27,240,137,122,13,204,50,22,140,208,44,101,193,121,178,171,73,45,172,173,86,140,217,15,0,239,226,40,102,134,149,227,15,111,211,119,27,223,45,43,182,199,238,43,196,218,138,71,227,46,108,125,169,71,114,151,221,192,118,98,185,238,67,243,41,98,129,75,225,94,31,125,209,71,126,80,148,132,237,155,186,211,96,37,236,24,12,79,128,150,251,86,237,53,116,156,23,119,28,58,70,139,251,14,51,11,83,201,254,170,35,129,133,176,173,184,219,231,22,79,147,56,89,210,196,23,55,111,156,230,184,187,21,239,56,122,177,61,121,195,149,182,7,42,177,215,126,192,197,49,38,242,14,9,241,38,78,144,111,48,90,143,76,55,68,136,249,185,56,136,161,178,252,141,95,234,141,92,143,112,229,162,216, 208,145,162,156,251,150,219,126,82,16,134,201,152,160,123,1,175,231,4,37,22,180,208,2,2,235,114,209,59,185,111,115,214,82,61,197,92,37,188,149,236,62,83,182,36,5,100,180,180,12,4,240,194,174,36,221,38,54,161,21,27,152,48,22,250,38,78,161,186,31,139,59,8,70,99,59,124,32,163,139,98,90,234,60,72,143,28,34,120,160,227,197,115,137,8,29,55,164,93,170,118,232,70,217,229,119,244,22,148,178,125,113,144,215,178,51,134,247,96,114,26,204,197,31,116,195,51,202,196,220,145,57,184,216,186,175,151,48,245,159,83,219,207,182,234,124,55,11,45,201,187,250,108,88,238,45,147,179,136,244,26,153,140,224,197,141,132,169,160,115,187,187,114,185,118,165,119,75,154,164,203,50,229,74,9,81,143,8,180,86,186,174,105,117,110,41,237,196,117,48,76,40,208,218,164,59,68,98,182,91,2,15,127,5,176,242,170,88,125,71,32,110,37,208,220,42,139,2,232,101,67,38,14,159,138,135,160,185,216,241,42,12,79,89,42,91,152,122,42,163,189,146,62,201,76,186, 59,147,157,255,63,212,16,186,157, - diff --git a/uppsrc/Core/src.tpp/algo$en-us.tpp b/uppsrc/Core/src.tpp/algo$en-us.tpp index 8eebcc231..0bc592cf9 100644 --- a/uppsrc/Core/src.tpp/algo$en-us.tpp +++ b/uppsrc/Core/src.tpp/algo$en-us.tpp @@ -9,4 +9,3 @@ COMPRESSED 1,244,157,183,208,249,188,169,186,182,220,28,31,51,37,142,247,170,5,1,35,88,119,51,33,159,217,121,145,85,81,173,21,241,241,165,54,30,9,26,101,83,6,86,64,154,203,54,212,150,237,134,205,134,119,222,97,2,116,47,155,252,207,35,188,74,103,127,76,188,22,17,79,120,178,250,61,197,182,208,112,39,216,180,59,192,207,46,43,91,0,255,245,215,162,133,30,219,71,83,231,172,47,84,67,220,83,56,48,229,1,224,188,169,31,140,108,197,77,125,78,1,160,246,145,40,128,159,153,108,149,114,248,210,109,234,171,180,245,118,169,20,188,215,154,253,252,47,3,62,122,246,51,192,233,203,236,77,120,131,126,129,128,207,23,149,68,38,16,232,183,19,172,51,58,203,155,246,139,185,183,246,215,243,223,20,88,128,222,85,203,192,191,50,66,126,1,155,154,139,172,93,205,15,252,152,118,114,174,117,13,157,174,179,58,121,101,226,5,242,195,64,51,157,24,34,72,70,165,99,95,180,64,180,62,212,202,240,252,24,253,186,13,144,191,194,100,216,115,199,117,47,129,100,122,135, 13,114,12,155,153,57,50,82,8,225,139,232,190,138,106,203,170,124,215,81,193,180,111,118,96,166,68,192,30,40,76,28,75,160,81,153,144,75,211,183,174,228,181,20,22,109,19,19,182,5,174,217,139,182,69,64,155,149,168,151,4,223,13,56,248,149,149,162,91,237,82,187,116,13,155,13,219,1,176,176,191,161,88,104,90,203,180,220,86,236,108,216,135,40,112,255,194,108,171,194,194,150,196,238,98,247,174,194,192,172,53,103,87,28,12,177,33,137,157,198,24,48,177,35,81,171,184,185,58,118,124,21,247,77,189,72,211,225,131,35,113,233,247,255,198,175,98,120,39,18,86,133,230,173,70,228,74,96,179,208,77,207,231,129,103,19,81,209,250,214,66,223,230,74,114,241,13,194,76,61,175,90,232,42,19,138,159,77,220,51,174,112,143,109,173,43,61,72,39,147,45,41,240,204,240,34,203,198,73,11,34,80,142,13,150,178,50,136,141,116,115,68,247,37,237,147,8,92,251,152,150,229,49,86,103,74,159,49,179,226,52,112,38,77,74,176,192,78,36,36,182,115,130,140,88,111, 162,142,70,40,124,188,99,182,222,145,88,64,154,103,172,247,117,83,157,30,109,2,105,16,207,222,97,249,119,159,226,240,247,125,206,141,190,36,244,161,122,92,52,116,35,146,64,131,182,192,92,95,221,20,226,172,124,61,186,89,148,248,130,221,59,59,206,137,68,83,146,20,49,55,2,164,30,31,29,47,68,143,248,184,115,241,131,42,24,163,248,104,131,25,18,156,24,167,21,194,178,173,118,142,89,229,187,64,193,205,122,206,76,22,54,1,148,44,129,154,89,57,146,180,206,83,122,96,204,106,24,147,182,173,140,3,116,211,56,53,139,197,155,204,186,93,36,92,243,127,35,201,112,73, - diff --git a/uppsrc/Core/srcdoc.tpp/BRC$en-us.tpp b/uppsrc/Core/srcdoc.tpp/BRC$en-us.tpp index 26297dfb8..9aad2562f 100644 --- a/uppsrc/Core/srcdoc.tpp/BRC$en-us.tpp +++ b/uppsrc/Core/srcdoc.tpp/BRC$en-us.tpp @@ -10,3 +10,4 @@ COMPRESSED 186,53,67,87,175,223,191,125,235,207,228,163,64,30,20,51,165,187,48,111,227,125,197,118,30,197,158,94,244,194,240,77,57,160,230,73,86,65,208,18,94,110,247,134,243,55,243,255,166,27,246,118,114,228,234,245,30,38,52,185,52,72,65,220,211,212,108,15,56,119,225,129,218,186,252,206,91,199,208,20,55,76,149,182,31,135,99,231,232,202,52,62,200,246,138,179,139,255,12,30,240,215,203,31,255,210,91,128,1,88,80,109,105,254,167,231,191,122,187,57,138,61,152,38,108,205,29,118,134,142,231,242,24,43,129,34,46,107,15,243,209,57,57,40,136,205,241,74,148,35,216,230,204,17,137,250,173,183,249,126,225,54,237,96,32,199,126,238,188,145,57,159,116,243,120,96,118,211,63,64,214,151,75,112,230,165,186,104,202,178,121,32,128,187,67,138,20,147,183,134,174,60,227,175,24,196,192,214,241,124,62,250,254,171,115,188,91,245,212,28,127,219,60,24,84,23,120,181,97,88,115,28,2,187,187,219,246,210,182,36,185,152,79,171,166,5,104,182,104,155,106,95,5,205,236,23, 80,122,84,11,78,189,246,9,172,174,109,79,122,158,63,252,182,110,113,234,200,221,234,252,168,142,219,97,80,220,61,103,107,2,232,225,103,211,54,120,59,50,109,5,112,132,214,118,45,248,183,236,174,41,231,131,82,118,87,47,223,230,218,29,163,46,101,131,129,88,233,238,238,108,184,200,206,12,78,84,186,51,119,221,176,221,107,175,23,140,110,161,192,123,111,77,27,119,107,176,158,166,217,134,30,193,152,119,41,142,166,18,47,55,36,101,175,160,158,70,76,199,254,141,232,229,207,130,142,247,159,175,126,216,187,190,110,175,131,190,54,66,98,87,38,47,22,148,177,191,169,211,154,83,139,119,25,84,84,206,233,20,249,92,224,34,60,167,104,51,252,42,166,23,132,241,81,113,213,81,93,35,66,185,167,141,222,148,142,173,126,95,223,120,205,218,108,239,167,222,86,251,19,55,111,170,85,235,143,74,111,231,116,81,166,47,154,182,192,139,69,223,142,17,123,75,211,69,73,255,239,183,37,34,236,200,83,94,249,59,122,185,9,6,83,253,251,213,181,20,187,59,187,166,83,7, 220,82,254,221,117,173,160,119,68,127,11,219,94,219,142,15,141,239,95,126,215,187,202,186,29,196,113,240,230,89,209,200,140,216,251,154,110,156,111,175,174,223,255,35,32,91,221,127,195,220,157,234,7,59,237,238,197,104,139,14,180,250,235,142,191,4,213,160,175,173,220,227,149,182,61,86,103,132,121,238,168,70,244,214,245,111,134,121,118,253,179,190,129,30,23,133,65,2,154,244,133,166,23,74,58,23,232,23,104,34,96,86,111,8,235,130,238,97,102,169,253,123,15,250,232,247,34,25,225,28,4,125,251,63,70,167,205,3, + diff --git a/uppsrc/Core/srcdoc.tpp/Translating$en-us.tpp b/uppsrc/Core/srcdoc.tpp/Translating$en-us.tpp index e47650116..99e0ffc76 100644 --- a/uppsrc/Core/srcdoc.tpp/Translating$en-us.tpp +++ b/uppsrc/Core/srcdoc.tpp/Translating$en-us.tpp @@ -34,3 +34,4 @@ COMPRESSED 181,175,33,159,15,189,120,1,249,4,10,121,54,10,5,105,158,247,218,249,255,174,228,145,87,208,225,175,72,134,158,67,191,165,67,255,7,144,95,189,147,251,86,253,183,250,244,218,255,111,68,191,30,123,55,199,208,235,239,143,140,246,212,236,141,35,64,159,15,129,18,222,54,233,199,94,191,234,117,221,199,222,206,43,124,54,56,58,248,172,55,111,48,6,29,239,13,25,64,254,229,245,24,72,3,125,1,234,244,102,94,225,127,128,107,99,67,160,121,95,188,107,239,143,244,36,189,248,210,8,232,31,95,129,42,140,189,153,187,248,87,99,10,207,70,70,193,205,87,35,195,207,223,104,245,118,68,226,167,195,159,246,102,29,190,206,9,138,249,59,232,40,20,50,212,243,240,179,23,67,175,190,156,159,248,210,135,111,141,251,4,250,6,230,75,251,159,127,115,46,0,242,139,31,253,253,223,126,252,163,191,253,41,228,233,123,127,243,179,167,63,252,155,159,129,142,31,126,62,242,249,216,211,31,246,70,98,158,190,247,209,59,194,191,250,171,47,89,158,190,247,221,231,111,167,139, 190,247,244,189,247,223,45,254,240,255,128,203,35,47,160,227,175,199,190,247,103,166,175,56,62,6,49,191,73,252,243,215,47,71,6,255,13,202,31,191,30,255,38,225,47,160,67,255,22,217,200,171,47,254,76,247,229,231,233,123,255,138,244,215,189,112,63,27,121,249,18,10,38,202,187,152,140,65,7,71,159,125,246,38,254,96,128,193,52,28,7,215,198,71,123,11,79,127,248,6,228,91,25,244,235,193,209,97,112,247,201,215,66,255,244,159,254,0,121,57,56,250,251,49,8,24,145,223,13,253,177,199,217,75,133,65,48,36,195,35,239,50,102,236,109,236,191,242,62,228,243,94,50,129,17,251,228,237,16,13,40,253,25,104,72,15,236,91,18,127,245,217,235,177,111,133,234,87,79,255,249,187,79,223,123,222,27,206,249,167,63,252,183,65,208,252,239,125,147,0,12,209,179,177,31,255,207,183,68,175,95,130,84,63,255,131,149,53,14,29,6,41,33,144,95,143,142,244,44,248,201,200,27,245,254,172,210,59,200,247,222,217,241,159,190,137,249,14,240,107,64,160,148,31,247,82, 244,219,115,65,247,63,128,252,227,187,185,162,175,77,4,129,14,248,42,21,255,63,35,70,189,64,188,126,249,38,28,175,160,160,119,71,161,127,24,130,126,254,230,112,131,92,96,25,120,9,29,253,244,237,17,31,3,79,203,51,40,152,253,31,143,65,159,244,82,235,235,112,111,96,158,64,254,110,228,37,20,98,214,65,62,126,179,248,139,161,79,70,7,193,82,241,238,16,127,123,99,168,55,163,3,10,122,59,166,244,4,50,212,247,120,248,125,200,199,195,67,96,225,123,91,18,127,54,12,70,124,248,77,213,26,124,49,244,191,222,220,252,57,71,126,251,255,0,169,222,145,9, + diff --git a/uppsrc/Core/z.h b/uppsrc/Core/z.h index bed8c2a7e..6f69deb4f 100644 --- a/uppsrc/Core/z.h +++ b/uppsrc/Core/z.h @@ -1,13 +1,13 @@ class Crc32 { dword crc; -public: +public: void Put(const void *ptr, int count); void Put(char c); void Put(byte c); operator dword() const { return crc; } - + Crc32(); }; diff --git a/uppsrc/CtrlCore/TopWindow.cpp b/uppsrc/CtrlCore/TopWindow.cpp index 419e1ba66..60c0e3dee 100644 --- a/uppsrc/CtrlCore/TopWindow.cpp +++ b/uppsrc/CtrlCore/TopWindow.cpp @@ -531,7 +531,7 @@ void ArrangeOKCancel(Ctrl& ok, Ctrl& cancel) Ctrl::LogPos h = ok.GetPos(); ok.SetPos(cancel.GetPos()); cancel.SetPos(h); - } + } } END_UPP_NAMESPACE diff --git a/uppsrc/CtrlCore/TopWindow.h b/uppsrc/CtrlCore/TopWindow.h index ccbce8d2b..703282c97 100644 --- a/uppsrc/CtrlCore/TopWindow.h +++ b/uppsrc/CtrlCore/TopWindow.h @@ -106,7 +106,7 @@ private: void SyncCaption(); void SetupRect(); - + void FixIcons(); enum { MINIMIZED, MAXIMIZED, OVERLAPPED }; @@ -202,7 +202,7 @@ public: TopWindow& Icon(const Image& m); TopWindow& LargeIcon(const Image& m); TopWindow& Icon(const Image& smallicon, const Image& largeicon); - + Image GetIcon() const { return icon; } Image GetLargeIcon() const { return largeicon; } diff --git a/uppsrc/CtrlLib/ChWin32.cpp b/uppsrc/CtrlLib/ChWin32.cpp index 6a5ccd2b7..9ddafad3c 100644 --- a/uppsrc/CtrlLib/ChWin32.cpp +++ b/uppsrc/CtrlLib/ChWin32.cpp @@ -306,7 +306,7 @@ void ChHostSkin() ColoredOverride(CtrlsImg::Iml(), CtrlsImg::Iml()); CtrlsImg::Reset(); EditFieldIsThin_Write(1); - + bool vista_aero = IsWinVista() && XpThemeInfo(L"ThemeName") == "Aero"; if(vista_aero) { diff --git a/uppsrc/CtrlLib/ColumnList.cpp b/uppsrc/CtrlLib/ColumnList.cpp index ffa44a358..d4e45e69e 100644 --- a/uppsrc/CtrlLib/ColumnList.cpp +++ b/uppsrc/CtrlLib/ColumnList.cpp @@ -90,7 +90,7 @@ void ColumnList::DoClick(Point p, dword flags) WhenLeftClickPos(p); } -void ColumnList::LeftDown(Point p, dword flags) { +void ColumnList::DoLeftDown(Point p, dword flags) { selclick = false; int i = GetDragColumn(p.x); if(i >= 0) { @@ -110,6 +110,10 @@ void ColumnList::LeftDown(Point p, dword flags) { } } +void ColumnList::LeftDown(Point p, dword flags) { + DoLeftDown(p, flags); +} + void ColumnList::LeftUp(Point p, dword flags) { if(selclick) @@ -135,7 +139,7 @@ void ColumnList::RightDown(Point p, dword flags) { } void ColumnList::LeftDouble(Point p, dword flags) { - LeftDown(p, flags); + DoLeftDown(p, flags); WhenLeftDouble(); } diff --git a/uppsrc/CtrlLib/ColumnList.h b/uppsrc/CtrlLib/ColumnList.h index bcbe70a3c..b3ff186e5 100644 --- a/uppsrc/CtrlLib/ColumnList.h +++ b/uppsrc/CtrlLib/ColumnList.h @@ -78,6 +78,7 @@ private: void SetCursor0(int c, bool sel); void UpdateSelect(); void RefreshSel(); + void DoLeftDown(Point p, dword); bool DnDInsert(int i, int py, PasteClip& d, int q); void DnD(int _drop, bool _insert); diff --git a/uppsrc/CtrlLib/Ctrl.lay b/uppsrc/CtrlLib/Ctrl.lay index 9d270dc30..6d959fbce 100644 --- a/uppsrc/CtrlLib/Ctrl.lay +++ b/uppsrc/CtrlLib/Ctrl.lay @@ -112,3 +112,4 @@ LAYOUT(PrinterLayout, 372, 264) ITEM(Switch, landscape, SetLabel(t_("Portrait\nLandscape")).LeftPosZ(16, 168).TopPosZ(194, 18)) ITEM(LabelBox, dv___21, SetLabel(t_("Placement")).LeftPosZ(8, 356).TopPosZ(176, 48)) END_LAYOUT + diff --git a/uppsrc/CtrlLib/CtrlLib.upp b/uppsrc/CtrlLib/CtrlLib.upp index df732a2fb..85a667438 100644 --- a/uppsrc/CtrlLib/CtrlLib.upp +++ b/uppsrc/CtrlLib/CtrlLib.upp @@ -121,4 +121,3 @@ file COPYING, COPYING-PLAIN, AUTHORS; - diff --git a/uppsrc/CtrlLib/DropChoice.h b/uppsrc/CtrlLib/DropChoice.h index e2d10f7ce..445eb3a9e 100644 --- a/uppsrc/CtrlLib/DropChoice.h +++ b/uppsrc/CtrlLib/DropChoice.h @@ -67,7 +67,7 @@ public: void Remove(int i); void ClearList(); void Clear(); - + DropList& AddSeparator(); void Drop(); @@ -149,7 +149,7 @@ public: void Clear(); void Add(const Value& data); void Serialize(Stream& s); - + int GetCount() const { return list.GetCount(); } Value Get(int i) const { return list.Get(i, 0); } diff --git a/uppsrc/CtrlLib/EditCtrl.h b/uppsrc/CtrlLib/EditCtrl.h index a24cbd1ee..bc5fc6f29 100644 --- a/uppsrc/CtrlLib/EditCtrl.h +++ b/uppsrc/CtrlLib/EditCtrl.h @@ -5,7 +5,7 @@ struct TextArrayOps { bool GetWordSelection(int c, int& sell, int& selh); int GetNextWord(int c); int GetPrevWord(int c); - + virtual ~TextArrayOps() {} }; diff --git a/uppsrc/CtrlLib/FileList.cpp b/uppsrc/CtrlLib/FileList.cpp index 159763f7e..5cb8cc64b 100644 --- a/uppsrc/CtrlLib/FileList.cpp +++ b/uppsrc/CtrlLib/FileList.cpp @@ -170,7 +170,7 @@ void FileList::LeftDown(Point p, dword flags) { bool FileList::FindChar(int from, int chr) { for(int i = max(0, from); i < GetCount(); i++) { - WString x = Get(i).name.ToWString(); // TRC patch 05/09/15; for CXL to check + WString x = Get(i).name.ToWString(); if(ToUpper(ToAscii(x[0])) == chr) { ClearSelection(); SetCursor(i); diff --git a/uppsrc/CtrlLib/SliderCtrl.h b/uppsrc/CtrlLib/SliderCtrl.h index 9b4b090b7..7a5c0aa8d 100644 --- a/uppsrc/CtrlLib/SliderCtrl.h +++ b/uppsrc/CtrlLib/SliderCtrl.h @@ -6,7 +6,6 @@ class SliderCtrl : public Ctrl { int SliderToClient(int value) const; int ClientToSlider(int x) const; - bool IsVert() const; int HoVe(int x, int y) const; int& HoVeR(int& x, int& y) const; @@ -36,6 +35,8 @@ public: int GetMin() const { return min; } int GetMax() const { return max; } + bool IsVert() const; + SliderCtrl& Step(int _step, bool _r = true) { step = _step; round_step = _r; return *this; } int GetStep() const { return step; } bool IsRoundStep() const { return round_step; } diff --git a/uppsrc/CtrlLib/ToolButton.cpp b/uppsrc/CtrlLib/ToolButton.cpp index 1908a7343..35f1da7e8 100644 --- a/uppsrc/CtrlLib/ToolButton.cpp +++ b/uppsrc/CtrlLib/ToolButton.cpp @@ -21,7 +21,7 @@ CH_STYLE(ToolButton, Style, StyleDefault) CH_STYLE(ToolButton, Style, StyleSolid) { - const Button::Style& bs = Button::StyleNormal(); + const Button::Style& bs = Button::StyleNormal(); look[0] = bs.look[0]; look[1] = bs.look[1]; look[2] = bs.look[2]; diff --git a/uppsrc/CtrlLib/src.tpp/TextCtrl$en-us.tpp b/uppsrc/CtrlLib/src.tpp/TextCtrl$en-us.tpp index 8a0d656f9..ccf5d98bb 100644 --- a/uppsrc/CtrlLib/src.tpp/TextCtrl$en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/TextCtrl$en-us.tpp @@ -18,3 +18,4 @@ COMPRESSED 235,39,99,202,100,206,249,97,30,142,2,240,148,8,167,204,76,240,156,56,15,88,23,182,7,191,239,62,27,176,89,165,248,45,57,102,157,201,49,112,146,151,36,77,57,53,137,54,204,33,172,66,197,141,35,108,168,205,9,113,183,94,90,198,185,110,225,217,27,227,243,217,187,15,111,15,78,49,193,12,175,145,95,127,237,118,187,157,97,175,215,235,255,136,87,55,254,52,216,239,142,8,66,251,236,135,126,79,41,32,73,200,36,87,195,105,228,38,147,225,144,183,194,70,103,120,7,156,140,223,248,80,27,241,211,146,52,143,78,198,7,175,78,143,143,82,84,207,21,57,225,246,36,254,14,240,143,183,244,129,123,180,99,63,227,227,211,227,195,243,76,63,227,84,38,127,215,241,191,63,120,127,252,97,27,42,75,138,187,62,21,201,126,56,62,56,122,119,118,250,175,20,225,247,9,197,44,50,120,89,160,241,220,115,157,213,238,125,109,7,167,26,27,135,239,78,223,1,233,195,119,31,207,206,211,194,205,214,11,112,110,120,137,40,11,26,147,223,126,211,212,189,192,122,37,90, 191,221,124,9,37,148,231,219,117,77,204,55,96,235,111,220,111,193,145,58,190,32,88,223,170,219,5,33,250,56,100,203,181,195,238,41,175,245,114,237,166,209,76,213,163,34,83,201,240,185,27,204,23,50,177,160,95,236,69,180,208,100,205,35,157,0,59,43,190,231,198,51,89,16,156,211,169,81,195,248,181,50,123,9,161,173,252,109,216,194,234,144,164,25,230,127,67,63,98,73,58,114,198,147,70,55,12,61,116,158,104,220,171,171,139,30,76,147,45,1,7,48,61,231,7,175,200,53,91,161,11,127,205,180,148,150,241,189,241,239,208,248,190,176,164,227,204,211,193,168,12,132,78,38,207,199,148,121,162,228,165,218,140,58,1,43,49,188,87,212,188,190,242,113,115,251,142,178,210,73,221,187,180,212,180,84,7,133,208,87,242,169,27,44,41,223,155,90,120,224,109,25,207,249,61,19,98,12,162,8,34,4,11,104,243,83,202,24,163,159,107,45,48,192,198,9,64,241,33,222,126,139,39,17,96,26,212,49,246,21,199,10,226,166,83,6,95,173,84,255,120,9,75,96,195,106, 86,23,97,58,191,114,54,185,150,1,77,194,82,56,204,60,148,214,135,133,59,139,172,76,110,104,195,204,41,179,119,171,55,206,153,47,233,76,80,242,170,128,49,70,38,21,48,193,159,201,255,0,167,177,223,165, + diff --git a/uppsrc/Draw/Draw.h b/uppsrc/Draw/Draw.h index 90016e3fe..acf9cd1d8 100644 --- a/uppsrc/Draw/Draw.h +++ b/uppsrc/Draw/Draw.h @@ -220,11 +220,11 @@ class FontInfo : Moveable { bool operator==(const CharMetrics& b) const { return width == b.width && lspc == b.lspc && rspc == b.rspc; } }; - + struct Kinfo : Moveable { CharMetrics std; byte *flags; - + Kinfo() { flags = NULL; } diff --git a/uppsrc/Draw/ImageOp.h b/uppsrc/Draw/ImageOp.h index bd47a1036..3c9abd933 100644 --- a/uppsrc/Draw/ImageOp.h +++ b/uppsrc/Draw/ImageOp.h @@ -119,10 +119,10 @@ struct ChPartMaker { Image image; Color border; Color bg; - + bool t, b, l, r; byte tl, tr, bl, br; - + void ResetShape(); Image Make() const; diff --git a/uppsrc/GLCtrl/GLCtrl.h b/uppsrc/GLCtrl/GLCtrl.h index d6526e9e8..a48e86436 100644 --- a/uppsrc/GLCtrl/GLCtrl.h +++ b/uppsrc/GLCtrl/GLCtrl.h @@ -15,39 +15,39 @@ NAMESPACE_UPP class GLCtrl : public DHCtrl { private: - + // OpenGL Context GLXContext WindowContext; // Number of instances static int Instances; - + // Current instance number int InstanceNum; - + // OpenGL parameters int DepthSize; int StencilSize; int NumberOfSamples; bool DoubleBuffering; bool MultiSampleBuffering; - + // Currently activated context number static int ContextActivated; // Activates current OpenGL context void ActivateContext(); - + // Ovverridden method to choose the correct visual virtual XVisualInfo *CreateVisual(void); - + // Overridden method for attribute setting virtual void SetAttributes(unsigned long &ValueMask, XSetWindowAttributes &attr); - + // Overridden method to create and destroy OpenGL context virtual void AfterInit(bool Error); virtual void BeforeTerminate(void); - + // Overridden method to resize GL windows virtual void Resize(int w, int h); @@ -57,46 +57,46 @@ class GLCtrl : public DHCtrl // Paint method - with graphic context // Called from DHCtrl - Graphic context is *not* uses virtual void Paint(Draw &/*draw*/); - + protected: - + // Overridable methods for derived controls - + // Called after succesful OpenGL initialization virtual void GLInit() {}; - + // Called just before OpenGL termination - virtual void GLDone() {}; - + virtual void GLDone() {}; + // Called on resize events virtual void GLResize( int w, int h ) {}; - + // Called on paint events virtual void GLPaint() {}; public: - + typedef GLCtrl CLASSNAME; // Constructor class GLCtrl - GLCtrl( int depthsize = 24, - int stencilsize = 0, - bool doublebuffer = true, - bool multisamplebuffering = false, + GLCtrl( int depthsize = 24, + int stencilsize = 0, + bool doublebuffer = true, + bool multisamplebuffering = false, int numberofsamples = 0 ); - + // Destructor class GLCtrl ~GLCtrl(); - + // Initializes OpenGL context to a standard view void StdView(); - + // Forces control repaint void PostPaintGL(); // same as Refresh() - + // Forces control resize void PostResizeGL(); - + }; // END Class GLCtrl #else diff --git a/uppsrc/GLCtrl/GLCtrl.upp b/uppsrc/GLCtrl/GLCtrl.upp index 73f5e635e..60e6ed9bd 100644 --- a/uppsrc/GLCtrl/GLCtrl.upp +++ b/uppsrc/GLCtrl/GLCtrl.upp @@ -11,3 +11,4 @@ file GLCtrl.h, Win32GlCtrl.cpp, X11GLCtrl.cpp; + diff --git a/uppsrc/GLCtrl/X11GLCtrl.cpp b/uppsrc/GLCtrl/X11GLCtrl.cpp index cb42c854a..22cc35145 100644 --- a/uppsrc/GLCtrl/X11GLCtrl.cpp +++ b/uppsrc/GLCtrl/X11GLCtrl.cpp @@ -16,14 +16,14 @@ GLCtrl::GLCtrl( int depthsize, int stencilsize, bool doublebuffer, { // Sets the current instance number and updates total instances InstanceNum = ++Instances; - + WindowContext = NULL; DepthSize = depthsize; StencilSize = stencilsize; DoubleBuffering = doublebuffer; NumberOfSamples = numberofsamples; - + } // END Constructor class GLCtrl ///////////////////////////////////////////////////////////////////////////////////////// @@ -37,7 +37,7 @@ GLCtrl::~GLCtrl() glXDestroyContext( (Display *)Xdisplay, WindowContext ); WindowContext = NULL; } - + } // END Destructor class GLCtrl ///////////////////////////////////////////////////////////////////////////////////////// @@ -69,12 +69,12 @@ XVisualInfo *GLCtrl::CreateVisual(void) SetError(true); SetErrorMessage("GLCtrl : Impossible to find a suitable visual."); } - + return visualInfo; } // END GLCtrl::CreateVisual() - + ///////////////////////////////////////////////////////////////////////////////////////// // Overridden method for attribute setting void GLCtrl::SetAttributes(unsigned long &ValueMask, XSetWindowAttributes &winAttributes) @@ -108,7 +108,7 @@ void GLCtrl::AfterInit(bool Error) { // Gets the activw XVisualInfo XVisualInfo visualInfo = GetVisualInfo(); - + // Create an OpenGL rendering context WindowContext = glXCreateContext ( @@ -123,10 +123,10 @@ void GLCtrl::AfterInit(bool Error) SetErrorMessage("GLCtrl : Error creating GLX context."); SetError(true); } - + // Activate the created glxwindow glXMakeCurrent( (Display*)Xdisplay, GetWindow(), WindowContext ); - + // Call user init function GLInit(); @@ -143,7 +143,7 @@ void GLCtrl::BeforeTerminate(void) { // Calls user terminate function GLDone(); - + // Resets context and destroys it glXMakeCurrent( (Display*)Xdisplay, None, NULL ); glXDestroyContext( (Display *)Xdisplay, WindowContext ); @@ -158,7 +158,7 @@ void GLCtrl::Resize(int x, int y) { // Activates the current context ActivateContext(); - + // Calls user resize hook GLResize(x, y); @@ -190,7 +190,7 @@ void GLCtrl::Paint(Draw &draw) { // Calls internal OpenGL Paint method doPaint(); - + } // END GLCtrl::Paint() @@ -201,7 +201,7 @@ void GLCtrl::PostResizeGL() // Gets sizes from Control int w = GetSize().cx, h = GetSize().cy; - + // Calls Resize method Resize(w, h); diff --git a/uppsrc/PdfDraw/PdfDraw.h b/uppsrc/PdfDraw/PdfDraw.h index 34f5c53f9..142df75b0 100644 --- a/uppsrc/PdfDraw/PdfDraw.h +++ b/uppsrc/PdfDraw/PdfDraw.h @@ -18,7 +18,7 @@ class TTFReader { TTFStream& operator%(uint32& q); TTFStream& operator%(int16& q); TTFStream& operator%(uint16& q); - + virtual ~TTFStream() {} }; @@ -34,7 +34,7 @@ class TTFReader { int Get16(); int Get32(); String Get(int n); - + virtual ~TTFStreamIn() {} }; diff --git a/uppsrc/RichEdit/RichEdit.lay b/uppsrc/RichEdit/RichEdit.lay index 23797ee58..3aee0baaa 100644 --- a/uppsrc/RichEdit/RichEdit.lay +++ b/uppsrc/RichEdit/RichEdit.lay @@ -195,3 +195,4 @@ LAYOUT(CellPropertiesLayout, 300, 260) ITEM(Button, ok, SetLabel(t_("OK")).LeftPosZ(164, 64).TopPosZ(232, 24)) ITEM(Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(232, 64).TopPosZ(232, 24)) END_LAYOUT + diff --git a/uppsrc/RichText/Para.h b/uppsrc/RichText/Para.h index 92f0d9000..efbab484e 100644 --- a/uppsrc/RichText/Para.h +++ b/uppsrc/RichText/Para.h @@ -58,7 +58,7 @@ struct RichPara { NUMBER_i, NUMBER_I, }; - + enum LINESPACING { LSP10 = 0, LSP15 = -1, diff --git a/uppsrc/Sql/Sqls.h b/uppsrc/Sql/Sqls.h index 3da972295..921581d31 100644 --- a/uppsrc/Sql/Sqls.h +++ b/uppsrc/Sql/Sqls.h @@ -308,7 +308,7 @@ public: virtual String Savepoint(); virtual void RollbackTo(const String& savepoint); - + virtual bool IsOpen() const; virtual RunScript GetRunScript() const; diff --git a/uppsrc/Sql/sch_header.h b/uppsrc/Sql/sch_header.h index 2bef733e0..c899c0a08 100644 --- a/uppsrc/Sql/sch_header.h +++ b/uppsrc/Sql/sch_header.h @@ -28,7 +28,7 @@ enum { ADD_SCHEMA_PREFIX_CPP2(name,_WIDTH) = width, ADD_SCHEMA_PREFIX_CPP2(name, #define COLUMN_ARRAY(type, ctype, name, width, prec, items) \ enum { ADD_SCHEMA_PREFIX_CPP2(name,_WIDTH) = width, ADD_SCHEMA_PREFIX_CPP2(name,_PRECISION) = prec }; ctype ADD_SCHEMA_PREFIX_CPP(name)[items]; - + #define END_TYPE }; #include SCHEMADIALECT @@ -39,7 +39,7 @@ enum { ADD_SCHEMA_PREFIX_CPP2(name,_WIDTH) = width, ADD_SCHEMA_PREFIX_CPP2(name, // SqlId -#define DOID(x) extern SqlId ADD_SCHEMA_PREFIX_CPP(x); +#define DOID(x) extern SqlId ADD_SCHEMA_PREFIX_CPP(x); //#define DOID(x) extern SqlId x; #include SCHEMADIALECT diff --git a/uppsrc/Web/socket.cpp b/uppsrc/Web/socket.cpp index 2d953f973..2aaa53880 100644 --- a/uppsrc/Web/socket.cpp +++ b/uppsrc/Web/socket.cpp @@ -698,6 +698,44 @@ String Socket::ReadUntil(char term, int timeout, int maxlen) } } +int Find(const String& s, Gate1 term, int seek) +{ + for(int i = seek; i < s.GetCount(); i++) + if(term(s[i])) + return i; + return -1; +} + +String Socket::ReadUntil(Gate1 term, int& termchar, int timeout, int maxlen) +{ + SLOG("Socket::RecvUntil(term = " << (int)term << ", maxlen = " << maxlen << ", timeout = " << timeout << ")"); + ASSERT(IsOpen() && maxlen != 0); + int ticks = GetTickCount(), end_ticks = IsNull(timeout) ? int(Null) : ticks + timeout, seek = 0; + String out = Read(timeout, maxlen); + if(out.IsVoid()) + return out; + + for(;;) { + int f = Find(out, term, seek); + if(f >= 0) { + termchar = out[f]; + data->leftover = String(out.Begin() + f + 1, out.GetLength() - f - 1) + data->leftover; + return out.Left(f); + } + seek = out.GetLength(); + ticks = GetTickCount(); + if(!IsNull(timeout)) timeout = end_ticks - ticks; + if(!IsNull(timeout) && timeout <= 0 || out.GetLength() >= maxlen) + return out; + String part = Read(timeout, maxlen - out.GetLength()); + if(part.IsVoid()) { + SLOG("term " << (int)term << " not found in: " << out); + return out; + } + out.Cat(part); + } +} + void Socket::UnRead(const void *buffer, int len) { ASSERT(len >= 0); diff --git a/uppsrc/Web/socket.h b/uppsrc/Web/socket.h index 985e105ff..6166aa6f4 100644 --- a/uppsrc/Web/socket.h +++ b/uppsrc/Web/socket.h @@ -102,6 +102,7 @@ public: int ReadCount(void *buffer, int count, int timeout_msec = Null); String ReadCount(int count, int timeout_msec = Null); String ReadUntil(char term, int timeout_msec = Null, int maxlen = 1000000); + String ReadUntil(Gate1 term, int& termchar, int timeout = Null, int maxlen = 1000000); void UnRead(const void *buffer, int len); void UnRead(String data) { UnRead(data.Begin(), data.GetLength()); } diff --git a/uppsrc/XmlView/XmlView.upp b/uppsrc/XmlView/XmlView.upp index a3603f8da..cae821962 100644 --- a/uppsrc/XmlView/XmlView.upp +++ b/uppsrc/XmlView/XmlView.upp @@ -11,3 +11,4 @@ file mainconfig "" = "GUI"; + diff --git a/uppsrc/XmlView/main.cpp b/uppsrc/XmlView/main.cpp index c9a099fad..6012bec74 100644 --- a/uppsrc/XmlView/main.cpp +++ b/uppsrc/XmlView/main.cpp @@ -168,7 +168,7 @@ XmlView::XmlView() dir = GetCurrentDirectory(); Icon(XmlImg::Icon()); - + xml.WhenLeftDouble = THISBACK(CopyPath); } diff --git a/uppsrc/ide/Browser/Browser.h b/uppsrc/ide/Browser/Browser.h index 0eb6abc36..45d79225b 100644 --- a/uppsrc/ide/Browser/Browser.h +++ b/uppsrc/ide/Browser/Browser.h @@ -365,11 +365,11 @@ public: void Open(const String& grouppath); void GoTo(const String& topic, const String& link); - + static int GetSerial(); static void SerializeEditPos(Stream& s); - + void Serialize(Stream& s); TopicEditor(); diff --git a/uppsrc/ide/Common/Common.h b/uppsrc/ide/Common/Common.h index 63fd3f58a..d0cc5b274 100644 --- a/uppsrc/ide/Common/Common.h +++ b/uppsrc/ide/Common/Common.h @@ -65,7 +65,7 @@ public: virtual bool IdeDebugUnLock() = 0; virtual bool IdeIsDebugLock() const = 0; virtual void IdeSetBar() = 0; - + virtual ~IdeContext() {} }; @@ -129,7 +129,7 @@ struct IdeModule { virtual IdeDesigner *CreateDesigner(Ide *ide, const char *path, byte charset) { return CreateDesigner(path, charset); } virtual IdeDesigner *CreateDesigner(const char *path, byte charset) { return NULL; } virtual void Serialize(Stream& s) {} - + virtual ~IdeModule() {} }; diff --git a/uppsrc/ide/FormatCode.cpp b/uppsrc/ide/FormatCode.cpp index 7d6df686d..804ac7190 100644 --- a/uppsrc/ide/FormatCode.cpp +++ b/uppsrc/ide/FormatCode.cpp @@ -177,7 +177,7 @@ void Ide::FormatCode() Formatter.setTabIndentation(editortabsize, true); else Formatter.setSpaceIndentation(indent_amount); - + WString Dest = FormatCodeString(Src, Formatter); editor.NextUndo(); diff --git a/uppsrc/ide/Install.cpp b/uppsrc/ide/Install.cpp index cc7720142..465a42007 100644 --- a/uppsrc/ide/Install.cpp +++ b/uppsrc/ide/Install.cpp @@ -261,11 +261,11 @@ String DefaultInstallFolder() DefaultFolder = "upp-svn"; else if(ExeTitle.Find("DEV") >= 0) DefaultFolder = "upp-dev"; - else if(ExeTitle.Find("BETA") >= 0) + else if(ExeTitle.Find("BETA") >= 0) DefaultFolder = "upp-beta"; else DefaultFolder = "upp"; - + return DefaultFolder; } @@ -329,9 +329,9 @@ bool Install() Progress pi; if(dlg.Run() != IDOK) return true; String upp(dlg.path); - + SaveFile(ConfigFile("installpath"), upp); - + String uppsrc; String pp; String out = AppendFileName(upp, "out"); diff --git a/uppsrc/ide/LayDes/laywin.cpp b/uppsrc/ide/LayDes/laywin.cpp index a9f77dd8a..bbb215d3f 100644 --- a/uppsrc/ide/LayDes/laywin.cpp +++ b/uppsrc/ide/LayDes/laywin.cpp @@ -339,7 +339,7 @@ struct LayDesModule : public IdeModule { s / version; SerializeLayEditPos(s); } - + virtual ~LayDesModule() {} }; diff --git a/uppsrc/ide/app.tpp/About$en-us.tpp b/uppsrc/ide/app.tpp/About$en-us.tpp index 385a58e71..ca3d4536c 100644 --- a/uppsrc/ide/app.tpp/About$en-us.tpp +++ b/uppsrc/ide/app.tpp/About$en-us.tpp @@ -56,4 +56,3 @@ COMPRESSED 31,88,15,187,57,245,126,171,170,37,149,239,239,127,121,170,151,24,111,47,79,117,93,24,247,189,68,21,231,88,2,91,37,219,79,123,48,129,83,120,164,191,209,213,170,206,185,111,114,197,170,165,224,13,175,90,181,118,209,163,92,185,106,37,205,35,92,189,234,169,190,119,95,193,234,98,144,189,220,160,114,241,106,9,209,94,180,197,126,247,160,115,62,232,138,225,187,174,233,141,213,27,232,126,88,135,226,109,191,219,197,75,8,15,222,117,250,71,221,22,62,215,239,226,19,39,167,102,36,61,7,117,199,114,6,130,167,79,233,115,247,47,195,238,201,80,156,117,251,239,123,195,33,140,186,255,73,116,206,206,96,146,206,254,49,60,222,249,104,183,209,253,203,65,247,108,40,62,190,235,158,136,83,156,237,99,15,150,55,24,118,240,189,222,137,248,216,239,13,123,39,71,52,46,118,226,234,247,142,222,13,197,187,211,227,195,110,159,218,117,61,61,237,155,193,104,0,190,82,172,59,16,103,253,211,15,189,67,127,175,163,39,157,1,108,103,244,196,92,112,102,118,3,187,238,156, 88,192,253,220,59,57,108,137,110,143,134,236,254,229,172,223,29,32,128,96,203,189,247,176,149,46,252,216,59,57,56,62,63,164,222,96,251,48,210,201,233,16,230,129,45,195,99,195,83,130,157,53,60,248,29,61,27,46,15,230,43,223,142,134,77,197,154,174,71,51,67,217,107,210,8,214,48,24,156,80,191,55,248,89,192,214,212,9,252,249,188,99,6,132,99,128,177,222,119,78,14,232,100,221,85,57,24,128,224,16,159,78,207,49,126,8,112,57,62,244,192,134,160,236,138,195,238,219,238,193,176,247,1,240,2,158,132,233,6,231,239,237,96,124,66,131,33,1,242,248,88,156,116,15,96,31,248,246,160,219,255,208,59,32,56,245,187,103,157,94,95,80,91,181,126,31,71,59,61,169,231,138,47,219,120,252,128,210,221,15,136,76,231,39,199,8,149,126,247,207,231,176,223,26,148,194,49,59,71,128,190,8,124,120,213,162,171,194,160,143,61,88,20,94,103,87,70,163,22,189,10,63,88,244,249,4,8,121,42,222,119,62,113,143,55,139,21,140,112,176,12,211,12,206,199,47, 56,2,139,246,157,253,83,132,213,62,254,76,203,132,133,1,224,204,96,120,196,135,157,247,157,163,238,192,65,38,90,138,234,87,215,18,131,179,238,65,15,255,1,191,3,50,3,174,28,11,7,227,15,78,129,108,255,124,142,88,0,63,168,193,68,7,208,1,71,66,252,230,35,23,72,244,136,187,39,26,215,96,45,138,17,84,208,97,203,174,165,138,215,226,248,116,64,200,123,216,25,118,4,237,0,254,222,239,194,211,102,160,126,247,4,224,74,4,220,57,56,56,239,3,49,227,147,248,38,172,110,112,14,228,221,59,225,67,68,68,34,54,210,235,31,26,202,197,243,176,80,234,244,142,207,251,26,119,205,34,97,37,167,0,106,28,154,112,215,30,224,224,244,237,16,232,172,187,221,34,220,17,189,183,86,132,156,31,188,83,167,142,147,184,7,254,14,142,110,191,11,143,119,14,63,244,136,210,121,62,160,181,65,79,193,12,190,194,17,204,112,10,222,141,29,8,225,207,157,151,186,226,165,72,230,210,36,113,241,255,0,68,186,0,53, - diff --git a/uppsrc/ide/app.tpp/Sponsor$en-us.tpp b/uppsrc/ide/app.tpp/Sponsor$en-us.tpp index a46725446..adffac415 100644 --- a/uppsrc/ide/app.tpp/Sponsor$en-us.tpp +++ b/uppsrc/ide/app.tpp/Sponsor$en-us.tpp @@ -22,4 +22,3 @@ COMPRESSED 201,113,84,194,11,244,77,255,14,67,170,98,248,243,53,30,217,121,120,206,28,114,163,22,253,158,159,64,100,169,102,105,34,77,252,8,239,138,147,227,119,172,173,150,126,53,131,106,161,240,52,175,162,232,216,89,220,186,44,29,58,59,106,105,195,93,176,97,83,122,139,113,150,40,16,246,233,117,228,105,53,25,219,59,188,55,242,218,126,123,147,193,96,228,51,245,115,175,109,203,149,214,173,54,202,189,66,133,107,216,213,97,144,130,221,219,8,127,224,154,73,121,7,234,76,5,187,216,219,85,239,36,11,205,148,79,70,8,16,184,151,242,200,40,27,202,156,172,50,108,11,40,157,201,83,193,68,179,236,157,85,70,69,128,164,238,226,220,94,90,222,92,75,160,101,195,157,84,157,173,42,235,197,195,29,43,253,216,167,197,201,248,194,27,231,89,191,228,222,10,230,84,182,179,45,181,60,28,243,8,201,186,142,61,19,143,93,178,195,152,146,184,147,90,94,224,56,112,55,55,52,81,237,206,181,75,203,113,26,169,121,215,102,89,116,125,94,192,239,119,14,180,77,171,245,16, 137,181,239,103,241,108,119,227,158,34,154,191,147,72,98,216,149,81,92,234,137,20,154,202,94,121,143,192,159,191,187,58,173,22,170,205,20,101,167,198,46,85,25,173,96,58,232,84,161,196,155,216,1,93,198,48,37,174,137,123,94,149,223,174,89,222,160,211,176,221,60,150,237,164,248,10,88,170,200,68,93,115,97,179,148,116,135,189,46,110,221,167,106,236,222,35,235,46,242,104,165,180,35,91,137,50,78,77,54,14,77,209,36,91,226,214,56,89,126,234,53,141,118,119,31,232,241,99,138,237,21,158,54,167,40,80,194,55,13,70,138,162,143,63,110,36,109,76,5,97,15,47,71,38,188,29,173,46,239,78,59,114,9,194,138,119,157,85,13,231,174,20,164,6,89,36,246,225,138,89,140,160,190,119,87,120,44,200,238,71,26,148,34,127,77,184,61,217,210,176,43,198,235,81,205,188,200,105,164,241,91,39,171,45,97,205,171,176,27,30,203,163,125,235,38,123,245,38,242,120,51,255,208,183,55,130,58,182,2,183,131,59,44,9,3,115,4,47,74,189,124,80,161,87,220,215, 247,168,12,77,188,50,191,178,96,57,32,207,221,9,71,78,165,156,81,185,14,214,240,235,84,93,52,114,79,86,232,135,131,206,60,237,190,113,239,22,177,34,179,241,225,53,105,54,119,221,245,142,204,205,29,99,104,20,26,150,6,97,71,188,227,126,247,47,142,56,136,143,63,206,215,239,172,248,47,255,7,168,39,54,51, - diff --git a/uppsrc/ide/app.tpp/index$en-us.tpp b/uppsrc/ide/app.tpp/index$en-us.tpp index 6fa00a9c8..c8e58e6a4 100644 --- a/uppsrc/ide/app.tpp/index$en-us.tpp +++ b/uppsrc/ide/app.tpp/index$en-us.tpp @@ -24,4 +24,3 @@ COMPRESSED 194,12,234,34,125,118,51,181,87,51,150,28,33,87,72,12,60,145,149,136,158,76,83,200,185,45,123,110,149,189,104,97,157,69,52,231,5,33,154,187,205,17,229,135,153,218,29,140,14,79,164,41,56,59,231,190,1,250,180,103,142,177,162,100,120,146,57,30,217,182,188,205,172,114,3,38,221,130,103,146,200,82,246,210,68,234,208,42,193,30,34,135,46,89,51,69,221,104,28,83,196,16,104,46,249,217,206,220,224,204,94,122,217,118,173,90,201,59,82,22,124,84,103,50,244,18,5,194,50,253,2,189,153,141,4,23,150,111,12,188,43,143,181,192,96,48,146,241,139,109,151,101,198,30,211,142,230,51,183,169,115,174,126,94,139,67,11,230,79,252,252,138,189,39,234,170,168,226,231,248,193,219,121,213,92,36,85,136,186,165,147,222,73,238,158,204,95,75,28,198,55,70,25,150,1,140,214,232,60,199,5,18,236,185,81,198,185,0,77,157,31,115,184,104,201,181,92,24,43,173,206,69,47,216,202,140,78,92,157,51,211,215,221,154,49,41,95,120,108,219,42,167,29,51,7,167, 74,203,214,140,74,230,11,58,133,100,237,181,53,30,10,238,177,125,184,180,248,58,58,60,192,217,25,59,62,166,137,114,151,246,121,218,41,39,31,237,183,79,103,68,71,219,41,194,226,245,146,166,96,54,47,163,241,214,197,4,129,237,200,223,80,68,253,151,18,73,16,63,82,11,173,56,253,169,130,226,54,179,48,201,239,191,220,223,204,166,178,133,40,101,46,199,78,103,25,197,131,216,129,77,137,17,79,227,43,116,41,195,24,62,34,46,184,148,30,171,122,120,138,78,195,151,146,120,182,141,226,78,225,169,34,35,117,220,142,79,80,98,215,236,9,113,241,38,154,99,223,222,179,46,253,247,102,202,149,127,38,156,25,83,145,13,85,99,32,194,150,56,212,54,150,135,122,68,163,93,222,120,111,249,65,249,236,8,79,115,42,79,81,124,199,121,70,148,162,11,221,79,69,44,76,249,228,2,65,134,14,187,174,53,218,164,35,182,115,26,158,28,113,77,176,178,190,211,125,57,41,79,22,137,221,99,103,9,156,224,98,225,50,117,159,146,222,212,212,24,121,242,104,242,100,99, 70,205,62,55,28,213,114,107,131,156,124,140,48,179,49,90,20,230,92,114,171,254,62,83,91,52,79,179,71,143,253,247,199,253,119,101,107,254,64,203,150,143,205,141,45,167,133,222,190,73,23,70,53,188,116,78,63,119,28,221,96,226,52,241,72,255,200,128,105,137,220,119,41,172,217,20,50,198,249,209,65,142,48,65,213,6,252,55,100,185,174,90,185,238,167,221,228,111,28,34,150,191,55,84,61,34,245,158,30,149,92,181,181,194,156,225,176,118,88,77,87,124,59,161,107,199,171,95,113,196,7,132,208,125,255,197,165,153,240,229,255,1,92,49,248,73, - diff --git a/uppsrc/plugin/astyle/ASFormatter.cpp b/uppsrc/plugin/astyle/ASFormatter.cpp index 43e879975..c9ed25a93 100644 --- a/uppsrc/plugin/astyle/ASFormatter.cpp +++ b/uppsrc/plugin/astyle/ASFormatter.cpp @@ -503,7 +503,7 @@ WString ASFormatter::nextLine() { int blockEnd = ASString_ReverseFind(currentLine, AS_CLOSE_BRACKET); assert(blockEnd != -1); - + // move ending comments to this formattedLine if (isBeforeLineEndComment(blockEnd)) { @@ -1202,7 +1202,7 @@ bool ASFormatter::isBeforeLineEndComment(int startPos) const if (endNum >= 0) if(ASString_Find_First_Not_Of(currentLine, " \t", endNum + 2) < 0) foundLineEndComment = true; - + } } return foundLineEndComment; @@ -1725,9 +1725,9 @@ void ASFormatter::padOperators(const WString *newOperator) && newOperator != &AS_RETURN && !(newOperator == &AS_MINUS && isInExponent()) && !(newOperator == &AS_MINUS // check for negative number - && (previousNonWSChar == '(' - || previousNonWSChar == '=' - || previousNonWSChar == ',')) + && (previousNonWSChar == '(' + || previousNonWSChar == '=' + || previousNonWSChar == ',')) && !(newOperator == &AS_PLUS && isInExponent()) && previousOperator != &AS_OPERATOR && !((newOperator == &AS_MULT || newOperator == &AS_BIT_AND) diff --git a/uppsrc/plugin/astyle/ASStringTools.cpp b/uppsrc/plugin/astyle/ASStringTools.cpp index a4b24f1fc..91fa56765 100644 --- a/uppsrc/plugin/astyle/ASStringTools.cpp +++ b/uppsrc/plugin/astyle/ASStringTools.cpp @@ -25,7 +25,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - + /* 2008-01-26 Patches by Massimo Del Fedele : - modified sources to use Ultimate++ containers instead std:: ones @@ -42,7 +42,7 @@ void ASString_Replace(WString &s, int Pos, int Len, WString const &newString) return; s.Remove(Pos, Len); s.Insert(Pos, newString); - + } // END ASString_Replace() /////////////////////////////////////////////////////////////////////////////////////////// @@ -58,7 +58,7 @@ int ASString_Find_First_Not_Of(WString const &s, WString const &Pattern, int pos return pos; else return -1; - + } // END ASString_Find_First_Not_Of() /////////////////////////////////////////////////////////////////////////////////////////// @@ -82,5 +82,5 @@ int ASString_ReverseFind(WString const &s, WString const &Pattern) while( (k = s.Find(Pattern, k)) >= 0) pos = k++; return pos; - + } // END ASString_ReverseFind() diff --git a/uppsrc/plugin/astyle/ASStringTools.hpp b/uppsrc/plugin/astyle/ASStringTools.hpp index af43f09f4..e37261658 100644 --- a/uppsrc/plugin/astyle/ASStringTools.hpp +++ b/uppsrc/plugin/astyle/ASStringTools.hpp @@ -25,7 +25,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - + /* 2008-01-26 Patches by Massimo Del Fedele : - modified sources to use Ultimate++ containers instead std:: ones diff --git a/uppsrc/plugin/astyle/astyle.h b/uppsrc/plugin/astyle/astyle.h index dc312c862..08f8fa5fc 100644 --- a/uppsrc/plugin/astyle/astyle.h +++ b/uppsrc/plugin/astyle/astyle.h @@ -25,7 +25,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - + /* 2008-01-26 Patches by Massimo Del Fedele : - modified sources to use Ultimate++ containers instead std:: ones @@ -501,3 +501,4 @@ namespace Upp } // end namespace Upp #endif // closes ASTYLE_H + diff --git a/uppsrc/plugin/astyle/astyle.upp b/uppsrc/plugin/astyle/astyle.upp index 097496552..dce8d7de3 100644 --- a/uppsrc/plugin/astyle/astyle.upp +++ b/uppsrc/plugin/astyle/astyle.upp @@ -9,3 +9,4 @@ file ASEnhancer.cpp, ASFormatter.cpp, ASResource.cpp; + diff --git a/uppsrc/plugin/pcx/pcx.upp b/uppsrc/plugin/pcx/pcx.upp index 98d2c9bc2..a4a7f30a7 100644 --- a/uppsrc/plugin/pcx/pcx.upp +++ b/uppsrc/plugin/pcx/pcx.upp @@ -3,3 +3,4 @@ file pcxhdr.h, pcx.cpp, pcxreg.icpp; + diff --git a/uppsrc/plugin/pcx/pcxhdr.h b/uppsrc/plugin/pcx/pcxhdr.h index d1490b15a..90a51ea38 100644 --- a/uppsrc/plugin/pcx/pcxhdr.h +++ b/uppsrc/plugin/pcx/pcxhdr.h @@ -6,7 +6,7 @@ #endif struct PCXRGB { - byte r, g, b; + byte r, g, b; } #ifdef COMPILER_GCC __attribute__((packed)) diff --git a/uppsrc/plugin/tif/lib/HOWTO-RELEASE b/uppsrc/plugin/tif/lib/HOWTO-RELEASE index dcb072cb9..6a37a72f2 100644 --- a/uppsrc/plugin/tif/lib/HOWTO-RELEASE +++ b/uppsrc/plugin/tif/lib/HOWTO-RELEASE @@ -1,20 +1,20 @@ -HOWTO-RELEASE: +HOWTO-RELEASE: Notes on releasing. You will need appropriate autoconf, automake and libtool utilities to release a package. -1. Commit any unsaved changes. +1. Commit any unsaved changes. 2. "make clean" -3. Create html/vX.X.html. Take ChangeLog entries and html-ify in there. +3. Create html/vX.X.html. Take ChangeLog entries and html-ify in there. Easist thing to do is take html/vX.(X-1).html and use it as a template. Add that file to the list of EXTRA_DIST files in the html/Makefile.am. 3.5. Update html/index.html to refer to this new page as the current release. 4. Increment version in configure.ac. Put 'alpha' or 'beta' after - the version, if applicable. + the version, if applicable. eg. 3.5.7 @@ -29,12 +29,12 @@ utilities to release a package. 6. sh configure 7. make release -- this will update "RELEASE-DATE" and "VERSION" in the top - level dir, and libtiff/tiffvers.h. + level dir, and libtiff/tiffvers.h. 8. Please verify that the version info in RELEASE-DATE, VERSION and libtiff/tiffvers.h is right. -9. make; make distcheck (to test). +9. make; make distcheck (to test). 10. make distclean @@ -46,10 +46,12 @@ utilities to release a package. Two files with names tiff-version.tar.gz and tiff-version.zip will be created in the top level package directory. -14. Copy to ftp.remotesensing.org ftp site. +14. Copy to ftp.remotesensing.org ftp site. scp tiff-*.tar.gz ftp.remotesensing.org:/var/ftp/libtiff/ scp tiff-*.zip ftp.remotesensing.org:/var/ftp/libtiff/ 15. Announce to list, tiff@lists.maptools.org 16. Update libtiff page on freshmeat with new version announcement. + + diff --git a/uppsrc/plugin/tif/lib/Makefile.am b/uppsrc/plugin/tif/lib/Makefile.am index 48914c6e6..a8780c7cf 100644 --- a/uppsrc/plugin/tif/lib/Makefile.am +++ b/uppsrc/plugin/tif/lib/Makefile.am @@ -2,23 +2,23 @@ # # Copyright (C) 2004, Andrey Kiselev # -# Permission to use, copy, modify, distribute, and sell this software and +# Permission to use, copy, modify, distribute, and sell this software and # its documentation for any purpose is hereby granted without fee, provided # that (i) the above copyright notices and this permission notice appear in # all copies of the software and related documentation, and (ii) the names of # Sam Leffler and Silicon Graphics may not be used in any advertising or # publicity relating to the software without the specific, prior written # permission of Sam Leffler and Silicon Graphics. -# -# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. -# +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# # IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR # ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF -# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE # OF THIS SOFTWARE. # Process this file with automake to produce Makefile.in. @@ -135,3 +135,4 @@ mkg3states_LDADD = $(LIBPORT) faxtable: mkg3states (rm -f tif_fax3sm.c && ./mkg3states -b -c const tif_fax3sm.c) + diff --git a/uppsrc/plugin/tif/lib/Makefile.in b/uppsrc/plugin/tif/lib/Makefile.in index 864cfad57..b313e40f6 100644 --- a/uppsrc/plugin/tif/lib/Makefile.in +++ b/uppsrc/plugin/tif/lib/Makefile.in @@ -18,23 +18,23 @@ # # Copyright (C) 2004, Andrey Kiselev # -# Permission to use, copy, modify, distribute, and sell this software and +# Permission to use, copy, modify, distribute, and sell this software and # its documentation for any purpose is hereby granted without fee, provided # that (i) the above copyright notices and this permission notice appear in # all copies of the software and related documentation, and (ii) the names of # Sam Leffler and Silicon Graphics may not be used in any advertising or # publicity relating to the software without the specific, prior written # permission of Sam Leffler and Silicon Graphics. -# -# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. -# +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# # IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR # ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF -# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE # OF THIS SOFTWARE. # Process this file with automake to produce Makefile.in. @@ -409,7 +409,7 @@ tif_config.h: stamp-h1 stamp-h1: $(srcdir)/tif_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status libtiff/tif_config.h -$(srcdir)/tif_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(srcdir)/tif_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ @@ -453,9 +453,9 @@ clean-libLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libtiff.la: $(libtiff_la_OBJECTS) $(libtiff_la_DEPENDENCIES) +libtiff.la: $(libtiff_la_OBJECTS) $(libtiff_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libtiff_la_LDFLAGS) $(libtiff_la_OBJECTS) $(libtiff_la_LIBADD) $(LIBS) -libtiffxx.la: $(libtiffxx_la_OBJECTS) $(libtiffxx_la_DEPENDENCIES) +libtiffxx.la: $(libtiffxx_la_OBJECTS) $(libtiffxx_la_DEPENDENCIES) $(CXXLINK) $(am_libtiffxx_la_rpath) $(libtiffxx_la_LDFLAGS) $(libtiffxx_la_OBJECTS) $(libtiffxx_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @@ -464,7 +464,7 @@ clean-noinstPROGRAMS: echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done -mkg3states$(EXEEXT): $(mkg3states_OBJECTS) $(mkg3states_DEPENDENCIES) +mkg3states$(EXEEXT): $(mkg3states_OBJECTS) $(mkg3states_DEPENDENCIES) @rm -f mkg3states$(EXEEXT) $(LINK) $(mkg3states_LDFLAGS) $(mkg3states_OBJECTS) $(mkg3states_LDADD) $(LIBS) diff --git a/uppsrc/plugin/tif/lib/Makefile.vc b/uppsrc/plugin/tif/lib/Makefile.vc index c113b5b89..e0b61f530 100644 --- a/uppsrc/plugin/tif/lib/Makefile.vc +++ b/uppsrc/plugin/tif/lib/Makefile.vc @@ -2,23 +2,23 @@ # # Copyright (C) 2004, Andrey Kiselev # -# Permission to use, copy, modify, distribute, and sell this software and +# Permission to use, copy, modify, distribute, and sell this software and # its documentation for any purpose is hereby granted without fee, provided # that (i) the above copyright notices and this permission notice appear in # all copies of the software and related documentation, and (ii) the names of # Sam Leffler and Silicon Graphics may not be used in any advertising or # publicity relating to the software without the specific, prior written # permission of Sam Leffler and Silicon Graphics. -# -# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. -# +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# # IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR # ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF -# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE # OF THIS SOFTWARE. # # Makefile for MS Visual C and Watcom C compilers. @@ -90,7 +90,7 @@ libtiff.lib: tif_config.h tiffconf.h $(OBJ) $(DLLNAME): tif_config.h tiffconf.h libtiff.def $(OBJ) $(LD) /debug /dll /def:libtiff.def /out:$(DLLNAME) \ /implib:libtiff_i.lib $(OBJ) $(LIBS) - + clean: -del *.obj -del *.lib diff --git a/uppsrc/plugin/tif/lib/SConstruct b/uppsrc/plugin/tif/lib/SConstruct index 9bac8b715..461723852 100644 --- a/uppsrc/plugin/tif/lib/SConstruct +++ b/uppsrc/plugin/tif/lib/SConstruct @@ -4,23 +4,23 @@ # # Copyright (C) 2005, Andrey Kiselev # -# Permission to use, copy, modify, distribute, and sell this software and +# Permission to use, copy, modify, distribute, and sell this software and # its documentation for any purpose is hereby granted without fee, provided # that (i) the above copyright notices and this permission notice appear in # all copies of the software and related documentation, and (ii) the names of # Sam Leffler and Silicon Graphics may not be used in any advertising or # publicity relating to the software without the specific, prior written # permission of Sam Leffler and Silicon Graphics. -# -# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. -# +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# # IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR # ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF -# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE # OF THIS SOFTWARE. # This file contains rules to build software with the SCons tool diff --git a/uppsrc/plugin/tif/lib/tif_apple.c b/uppsrc/plugin/tif/lib/tif_apple.c index c53452617..47e0e0767 100644 --- a/uppsrc/plugin/tif/lib/tif_apple.c +++ b/uppsrc/plugin/tif/lib/tif_apple.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -169,7 +169,7 @@ TIFFOpen(const char* name, const char* mode) strcpy((char*) pname, name); ourc2pstr((char*) pname); - + err = FSMakeFSSpec( 0, 0, pname, &fSpec ); switch (_TIFFgetMode(mode, module)) { diff --git a/uppsrc/plugin/tif/lib/tif_atari.c b/uppsrc/plugin/tif/lib/tif_atari.c index a78c8af25..a519fa442 100644 --- a/uppsrc/plugin/tif/lib/tif_atari.c +++ b/uppsrc/plugin/tif/lib/tif_atari.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ diff --git a/uppsrc/plugin/tif/lib/tif_aux.c b/uppsrc/plugin/tif/lib/tif_aux.c index d99e59248..9b0c5c223 100644 --- a/uppsrc/plugin/tif/lib/tif_aux.c +++ b/uppsrc/plugin/tif/lib/tif_aux.c @@ -4,23 +4,23 @@ * Copyright (c) 1991-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -219,7 +219,7 @@ TIFFVGetFieldDefaulted(TIFF* tif, ttag_t tag, va_list ap) case TIFFTAG_REFERENCEBLACKWHITE: { int i; - static float ycbcr_refblackwhite[] = + static float ycbcr_refblackwhite[] = { 0.0F, 255.0F, 128.0F, 255.0F, 128.0F, 255.0F }; static float rgb_refblackwhite[6]; @@ -228,7 +228,7 @@ TIFFVGetFieldDefaulted(TIFF* tif, ttag_t tag, va_list ap) rgb_refblackwhite[2 * i + 1] = (float)((1L<td_bitspersample)-1L); } - + if (td->td_photometric == PHOTOMETRIC_YCBCR) { /* * YCbCr (Class Y) images must have the diff --git a/uppsrc/plugin/tif/lib/tif_close.c b/uppsrc/plugin/tif/lib/tif_close.c index 021f157ed..52f53c0eb 100644 --- a/uppsrc/plugin/tif/lib/tif_close.c +++ b/uppsrc/plugin/tif/lib/tif_close.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -38,7 +38,7 @@ * completetly freed, so you should save opened file handle and pointer * to the close procedure in external variables before calling * _TIFFCleanup(), if you will need these ones to close the file. - * + * * @param tif A TIFF pointer. */ @@ -55,7 +55,7 @@ TIFFCleanup(TIFF* tif) if (tif->tif_dirlist) _TIFFfree(tif->tif_dirlist); - + /* Clean up client info links */ while( tif->tif_clientinfo ) { @@ -72,21 +72,21 @@ TIFFCleanup(TIFF* tif) TIFFUnmapFileContents(tif, tif->tif_base, tif->tif_size); /* Clean up custom fields */ - if (tif->tif_nfields > 0) + if (tif->tif_nfields > 0) { size_t i; - for (i = 0; i < tif->tif_nfields; i++) + for (i = 0; i < tif->tif_nfields; i++) { TIFFFieldInfo *fld = tif->tif_fieldinfo[i]; - if (fld->field_bit == FIELD_CUSTOM && - strncmp("Tag ", fld->field_name, 4) == 0) + if (fld->field_bit == FIELD_CUSTOM && + strncmp("Tag ", fld->field_name, 4) == 0) { _TIFFfree(fld->field_name); _TIFFfree(fld); } - } - + } + _TIFFfree(tif->tif_fieldinfo); } @@ -103,7 +103,7 @@ TIFFCleanup(TIFF* tif) * TIFFClose closes a file that was previously opened with TIFFOpen(). * Any buffered data are flushed to the file, including the contents of * the current directory (if modified); and all resources are reclaimed. - * + * * @param tif A TIFF pointer. */ @@ -116,3 +116,4 @@ TIFFClose(TIFF* tif) TIFFCleanup(tif); (void) (*closeproc)(fd); } + diff --git a/uppsrc/plugin/tif/lib/tif_codec.c b/uppsrc/plugin/tif/lib/tif_codec.c index 27911c35f..c31d10c73 100644 --- a/uppsrc/plugin/tif/lib/tif_codec.c +++ b/uppsrc/plugin/tif/lib/tif_codec.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -91,7 +91,7 @@ TIFFCodec _TIFFBuiltinCODECS[] = { { "CCITT Group 4", COMPRESSION_CCITTFAX4, TIFFInitCCITTFax4 }, { "ISO JBIG", COMPRESSION_JBIG, TIFFInitJBIG }, { "Deflate", COMPRESSION_DEFLATE, TIFFInitZIP }, - { "AdobeDeflate", COMPRESSION_ADOBE_DEFLATE , TIFFInitZIP }, + { "AdobeDeflate", COMPRESSION_ADOBE_DEFLATE , TIFFInitZIP }, { "PixarLog", COMPRESSION_PIXARLOG, TIFFInitPixarLog }, { "SGILog", COMPRESSION_SGILOG, TIFFInitSGILog }, { "SGILog24", COMPRESSION_SGILOG24, TIFFInitSGILog }, @@ -112,7 +112,7 @@ static int NotConfigured(TIFF* tif, int scheme) { (void) scheme; - + tif->tif_decodestatus = FALSE; tif->tif_setupdecode = _notConfigured; tif->tif_encodestatus = FALSE; @@ -126,7 +126,7 @@ NotConfigured(TIFF* tif, int scheme) /** * Check whether we have working codec for the specific coding scheme. - * + * * @return returns 1 if the codec is configured and working. Otherwise * 0 will be returned. */ @@ -147,3 +147,4 @@ TIFFIsCODECConfigured(uint16 scheme) } return 0; } + diff --git a/uppsrc/plugin/tif/lib/tif_color.c b/uppsrc/plugin/tif/lib/tif_color.c index 066c3260f..0f484aa7c 100644 --- a/uppsrc/plugin/tif/lib/tif_color.c +++ b/uppsrc/plugin/tif/lib/tif_color.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -60,13 +60,13 @@ TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32 l, int32 a, int32 b, tmp = (float)a / 500.0F + cby; if( tmp < 0.2069F ) *X = cielab->X0 * (tmp - 0.13793F) / 7.787F; - else + else *X = cielab->X0 * tmp * tmp * tmp; tmp = cby - (float)b / 200.0F; if( tmp < 0.2069F ) *Z = cielab->Z0 * (tmp - 0.13793F) / 7.787F; - else + else *Z = cielab->Z0 * tmp * tmp * tmp; } @@ -117,7 +117,7 @@ TIFFXYZToRGB(TIFFCIELabToRGB *cielab, float X, float Y, float Z, } #undef RINT -/* +/* * Allocate conversion state structures and make look_up tables for * the Yr,Yb,Yg <=> r,g,b conversions. */ @@ -167,7 +167,7 @@ TIFFCIELabToRGBInit(TIFFCIELabToRGB* cielab, return 0; } -/* +/* * Convert color value from the YCbCr space to CIE XYZ. * The colorspace conversion algorithm comes from the IJG v5a code; * see below for more information on how it works. @@ -213,7 +213,7 @@ TIFFYCbCrToRGBInit(TIFFYCbCrToRGB* ycbcr, float *luma, float *refBlackWhite) { TIFFRGBValue* clamptab; int i; - + #define LumaRed luma[0] #define LumaGreen luma[1] #define LumaBlue luma[2] @@ -240,7 +240,7 @@ TIFFYCbCrToRGBInit(TIFFYCbCrToRGB* ycbcr, float *luma, float *refBlackWhite) #undef LumaBlue #undef LumaGreen #undef LumaRed - + /* * i is the actual input pixel value in the range 0..255 * Cb and Cr values are in the range -128..127 (actually diff --git a/uppsrc/plugin/tif/lib/tif_compress.c b/uppsrc/plugin/tif/lib/tif_compress.c index d0ad95f27..f7bb2a5ae 100644 --- a/uppsrc/plugin/tif/lib/tif_compress.c +++ b/uppsrc/plugin/tif/lib/tif_compress.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -36,10 +36,10 @@ TIFFNoEncode(TIFF* tif, const char* method) { const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); - if (c) { + if (c) { TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%s %s encoding is not implemented", c->name, method); - } else { + } else { TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Compression scheme %u %s encoding is not implemented", tif->tif_dir.td_compression, method); @@ -234,7 +234,7 @@ TIFFUnRegisterCODEC(TIFFCodec* c) /** * Get list of configured codecs, both built-in and registered by user. * Caller is responsible to free this structure. - * + * * @return returns array of TIFFCodec records (the last record should be NULL) * or NULL if function failed. */ diff --git a/uppsrc/plugin/tif/lib/tif_dir.c b/uppsrc/plugin/tif/lib/tif_dir.c index 985a17389..160256753 100644 --- a/uppsrc/plugin/tif/lib/tif_dir.c +++ b/uppsrc/plugin/tif/lib/tif_dir.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -121,7 +121,7 @@ static int _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap) { static const char module[] = "_TIFFVSetField"; - + TIFFDirectory* td = &tif->tif_dir; int status = 1; uint32 v32, i, v; @@ -326,11 +326,11 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap) td->td_sampleformat = (uint16) v; /* Try to fix up the SWAB function for complex data. */ - if( td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT + if( td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT && td->td_bitspersample == 32 && tif->tif_postdecode == _TIFFSwab32BitData ) tif->tif_postdecode = _TIFFSwab16BitData; - else if( (td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT + else if( (td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT || td->td_sampleformat == SAMPLEFORMAT_COMPLEXIEEEFP) && td->td_bitspersample == 64 && tif->tif_postdecode == _TIFFSwab64BitData ) @@ -417,7 +417,7 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap) */ if(tv == NULL) { TIFFTagValue *new_customValues; - + td->td_customValueCount++; new_customValues = (TIFFTagValue *) _TIFFrealloc(td->td_customValues, @@ -450,7 +450,7 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap) fip->field_name); goto end; } - + if(fip->field_passcount) { if (fip->field_writecount == TIFF_VARIABLE2) tv->count = (uint32) va_arg(ap, uint32); @@ -463,8 +463,8 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap) tv->count = td->td_samplesperpixel; else tv->count = fip->field_writecount; - - + + if (fip->field_type == TIFF_ASCII) _TIFFsetString((char **)&tv->value, va_arg(ap, char *)); else { @@ -804,12 +804,12 @@ _TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap) { const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY); int i; - + /* * This can happen if multiple images are open with * different codecs which have private tags. The * global tag information table may then have tags - * that are valid for one file but not the other. + * that are valid for one file but not the other. * If the client tries to get a tag that is not valid * for the image's codec then we'll arrive here. */ @@ -832,9 +832,9 @@ _TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap) if (tv->info->field_tag != tag) continue; - + if (fip->field_passcount) { - if (fip->field_readcount == TIFF_VARIABLE2) + if (fip->field_readcount == TIFF_VARIABLE2) *va_arg(ap, uint32*) = (uint32)tv->count; else /* Assume TIFF_VARIABLE */ *va_arg(ap, uint16*) = (uint16)tv->count; @@ -1150,7 +1150,7 @@ TIFFNumberOfDirectories(TIFF* tif) { toff_t nextdir = tif->tif_header.tiff_diroff; tdir_t n = 0; - + while (nextdir != 0 && TIFFAdvanceDirectory(tif, &nextdir, NULL)) n++; return (n); @@ -1327,7 +1327,7 @@ TIFFReassignTagToIgnore (enum TIFFIgnoreSense task, int TIFFtagID) return (TRUE) ; } break ; - + case TIS_EXTRACT: for ( i = 0 ; i < tagcount ; ++i ) { @@ -1335,15 +1335,15 @@ TIFFReassignTagToIgnore (enum TIFFIgnoreSense task, int TIFFtagID) return (TRUE) ; } break; - + case TIS_EMPTY: tagcount = 0 ; /* Clear the list */ return (TRUE) ; - + default: break; } - + return (FALSE); } diff --git a/uppsrc/plugin/tif/lib/tif_dir.h b/uppsrc/plugin/tif/lib/tif_dir.h index db086d801..13048c296 100644 --- a/uppsrc/plugin/tif/lib/tif_dir.h +++ b/uppsrc/plugin/tif/lib/tif_dir.h @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -94,7 +94,7 @@ typedef struct { * Note that a bit *is* allocated for ignored tags; * this is understood by the directory reading logic * which uses this fact to avoid special-case handling - */ + */ #define FIELD_IGNORE 0 /* multi-item fields */ @@ -162,9 +162,9 @@ typedef struct { (v) & (tif)->tif_typemask[type])) -#define BITn(n) (((unsigned long)1L)<<((n)&0x1f)) -#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n)/32]) -#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field)) +#define BITn(n) (((unsigned long)1L)<<((n)&0x1f)) +#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n)/32]) +#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field)) #define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field)) #define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field)) diff --git a/uppsrc/plugin/tif/lib/tif_dirinfo.c b/uppsrc/plugin/tif/lib/tif_dirinfo.c index 32d0c7250..c22178f78 100644 --- a/uppsrc/plugin/tif/lib/tif_dirinfo.c +++ b/uppsrc/plugin/tif/lib/tif_dirinfo.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -39,8 +39,8 @@ * * NOTE: The second field (field_readcount) and third field (field_writecount) * sometimes use the values TIFF_VARIABLE (-1), TIFF_VARIABLE2 (-3) - * and TIFFTAG_SPP (-2). The macros should be used but would throw off - * the formatting of the code, so please interprete the -1, -2 and -3 + * and TIFFTAG_SPP (-2). The macros should be used but would throw off + * the formatting of the code, so please interprete the -1, -2 and -3 * values accordingly. */ static const TIFFFieldInfo @@ -255,9 +255,9 @@ tiffFieldInfo[] = { { TIFFTAG_COPYRIGHT, -1, -1, TIFF_ASCII, FIELD_CUSTOM, 1, 0, "Copyright" }, /* end Pixar tags */ - { TIFFTAG_RICHTIFFIPTC, -3, -3, TIFF_LONG, FIELD_CUSTOM, + { TIFFTAG_RICHTIFFIPTC, -3, -3, TIFF_LONG, FIELD_CUSTOM, 0, 1, "RichTIFFIPTC" }, - { TIFFTAG_PHOTOSHOP, -3, -3, TIFF_BYTE, FIELD_CUSTOM, + { TIFFTAG_PHOTOSHOP, -3, -3, TIFF_BYTE, FIELD_CUSTOM, 0, 1, "Photoshop" }, { TIFFTAG_EXIFIFD, 1, 1, TIFF_LONG, FIELD_CUSTOM, 0, 0, "EXIFIFDOffset" }, @@ -270,9 +270,9 @@ tiffFieldInfo[] = { { TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_LONG, FIELD_CUSTOM, 0, 0, "InteroperabilityIFDOffset" }, /* begin DNG tags */ - { TIFFTAG_DNGVERSION, 4, 4, TIFF_BYTE, FIELD_CUSTOM, + { TIFFTAG_DNGVERSION, 4, 4, TIFF_BYTE, FIELD_CUSTOM, 0, 0, "DNGVersion" }, - { TIFFTAG_DNGBACKWARDVERSION, 4, 4, TIFF_BYTE, FIELD_CUSTOM, + { TIFFTAG_DNGBACKWARDVERSION, 4, 4, TIFF_BYTE, FIELD_CUSTOM, 0, 0, "DNGBackwardVersion" }, { TIFFTAG_UNIQUECAMERAMODEL, -1, -1, TIFF_ASCII, FIELD_CUSTOM, 1, 0, "UniqueCameraModel" }, @@ -280,93 +280,93 @@ tiffFieldInfo[] = { 1, 0, "LocalizedCameraModel" }, { TIFFTAG_LOCALIZEDCAMERAMODEL, -1, -1, TIFF_BYTE, FIELD_CUSTOM, 1, 1, "LocalizedCameraModel" }, - { TIFFTAG_CFAPLANECOLOR, -1, -1, TIFF_BYTE, FIELD_CUSTOM, + { TIFFTAG_CFAPLANECOLOR, -1, -1, TIFF_BYTE, FIELD_CUSTOM, 0, 1, "CFAPlaneColor" }, - { TIFFTAG_CFALAYOUT, 1, 1, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_CFALAYOUT, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 0, 0, "CFALayout" }, - { TIFFTAG_LINEARIZATIONTABLE, -1, -1, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_LINEARIZATIONTABLE, -1, -1, TIFF_SHORT, FIELD_CUSTOM, 0, 1, "LinearizationTable" }, - { TIFFTAG_BLACKLEVELREPEATDIM, 2, 2, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_BLACKLEVELREPEATDIM, 2, 2, TIFF_SHORT, FIELD_CUSTOM, 0, 0, "BlackLevelRepeatDim" }, - { TIFFTAG_BLACKLEVEL, -1, -1, TIFF_LONG, FIELD_CUSTOM, + { TIFFTAG_BLACKLEVEL, -1, -1, TIFF_LONG, FIELD_CUSTOM, 0, 1, "BlackLevel" }, - { TIFFTAG_BLACKLEVEL, -1, -1, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_BLACKLEVEL, -1, -1, TIFF_SHORT, FIELD_CUSTOM, 0, 1, "BlackLevel" }, - { TIFFTAG_BLACKLEVEL, -1, -1, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_BLACKLEVEL, -1, -1, TIFF_RATIONAL, FIELD_CUSTOM, 0, 1, "BlackLevel" }, - { TIFFTAG_BLACKLEVELDELTAH, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, + { TIFFTAG_BLACKLEVELDELTAH, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, 0, 1, "BlackLevelDeltaH" }, - { TIFFTAG_BLACKLEVELDELTAV, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, + { TIFFTAG_BLACKLEVELDELTAV, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, 0, 1, "BlackLevelDeltaV" }, - { TIFFTAG_WHITELEVEL, -2, -2, TIFF_LONG, FIELD_CUSTOM, + { TIFFTAG_WHITELEVEL, -2, -2, TIFF_LONG, FIELD_CUSTOM, 0, 0, "WhiteLevel" }, - { TIFFTAG_WHITELEVEL, -2, -2, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_WHITELEVEL, -2, -2, TIFF_SHORT, FIELD_CUSTOM, 0, 0, "WhiteLevel" }, - { TIFFTAG_DEFAULTSCALE, 2, 2, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_DEFAULTSCALE, 2, 2, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "DefaultScale" }, - { TIFFTAG_BESTQUALITYSCALE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_BESTQUALITYSCALE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "BestQualityScale" }, - { TIFFTAG_DEFAULTCROPORIGIN, 2, 2, TIFF_LONG, FIELD_CUSTOM, + { TIFFTAG_DEFAULTCROPORIGIN, 2, 2, TIFF_LONG, FIELD_CUSTOM, 0, 0, "DefaultCropOrigin" }, - { TIFFTAG_DEFAULTCROPORIGIN, 2, 2, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_DEFAULTCROPORIGIN, 2, 2, TIFF_SHORT, FIELD_CUSTOM, 0, 0, "DefaultCropOrigin" }, - { TIFFTAG_DEFAULTCROPORIGIN, 2, 2, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_DEFAULTCROPORIGIN, 2, 2, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "DefaultCropOrigin" }, - { TIFFTAG_DEFAULTCROPSIZE, 2, 2, TIFF_LONG, FIELD_CUSTOM, + { TIFFTAG_DEFAULTCROPSIZE, 2, 2, TIFF_LONG, FIELD_CUSTOM, 0, 0, "DefaultCropSize" }, - { TIFFTAG_DEFAULTCROPSIZE, 2, 2, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_DEFAULTCROPSIZE, 2, 2, TIFF_SHORT, FIELD_CUSTOM, 0, 0, "DefaultCropSize" }, - { TIFFTAG_DEFAULTCROPSIZE, 2, 2, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_DEFAULTCROPSIZE, 2, 2, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "DefaultCropSize" }, - { TIFFTAG_COLORMATRIX1, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, + { TIFFTAG_COLORMATRIX1, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, 0, 1, "ColorMatrix1" }, - { TIFFTAG_COLORMATRIX2, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, + { TIFFTAG_COLORMATRIX2, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, 0, 1, "ColorMatrix2" }, - { TIFFTAG_CAMERACALIBRATION1, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, + { TIFFTAG_CAMERACALIBRATION1, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, 0, 1, "CameraCalibration1" }, - { TIFFTAG_CAMERACALIBRATION2, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, + { TIFFTAG_CAMERACALIBRATION2, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, 0, 1, "CameraCalibration2" }, - { TIFFTAG_REDUCTIONMATRIX1, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, + { TIFFTAG_REDUCTIONMATRIX1, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, 0, 1, "ReductionMatrix1" }, - { TIFFTAG_REDUCTIONMATRIX2, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, + { TIFFTAG_REDUCTIONMATRIX2, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, 0, 1, "ReductionMatrix2" }, - { TIFFTAG_ANALOGBALANCE, -1, -1, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_ANALOGBALANCE, -1, -1, TIFF_RATIONAL, FIELD_CUSTOM, 0, 1, "AnalogBalance" }, - { TIFFTAG_ASSHOTNEUTRAL, -1, -1, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_ASSHOTNEUTRAL, -1, -1, TIFF_SHORT, FIELD_CUSTOM, 0, 1, "AsShotNeutral" }, - { TIFFTAG_ASSHOTNEUTRAL, -1, -1, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_ASSHOTNEUTRAL, -1, -1, TIFF_RATIONAL, FIELD_CUSTOM, 0, 1, "AsShotNeutral" }, - { TIFFTAG_ASSHOTWHITEXY, 2, 2, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_ASSHOTWHITEXY, 2, 2, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "AsShotWhiteXY" }, - { TIFFTAG_BASELINEEXPOSURE, 1, 1, TIFF_SRATIONAL, FIELD_CUSTOM, + { TIFFTAG_BASELINEEXPOSURE, 1, 1, TIFF_SRATIONAL, FIELD_CUSTOM, 0, 0, "BaselineExposure" }, - { TIFFTAG_BASELINENOISE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_BASELINENOISE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "BaselineNoise" }, - { TIFFTAG_BASELINESHARPNESS, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_BASELINESHARPNESS, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "BaselineSharpness" }, - { TIFFTAG_BAYERGREENSPLIT, 1, 1, TIFF_LONG, FIELD_CUSTOM, + { TIFFTAG_BAYERGREENSPLIT, 1, 1, TIFF_LONG, FIELD_CUSTOM, 0, 0, "BayerGreenSplit" }, - { TIFFTAG_LINEARRESPONSELIMIT, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_LINEARRESPONSELIMIT, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "LinearResponseLimit" }, { TIFFTAG_CAMERASERIALNUMBER, -1, -1, TIFF_ASCII, FIELD_CUSTOM, 1, 0, "CameraSerialNumber" }, - { TIFFTAG_LENSINFO, 4, 4, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_LENSINFO, 4, 4, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "LensInfo" }, - { TIFFTAG_CHROMABLURRADIUS, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_CHROMABLURRADIUS, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "ChromaBlurRadius" }, - { TIFFTAG_ANTIALIASSTRENGTH, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_ANTIALIASSTRENGTH, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "AntiAliasStrength" }, - { TIFFTAG_SHADOWSCALE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { TIFFTAG_SHADOWSCALE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 0, 0, "ShadowScale" }, { TIFFTAG_DNGPRIVATEDATA, -1, -1, TIFF_BYTE, FIELD_CUSTOM, 0, 1, "DNGPrivateData" }, - { TIFFTAG_MAKERNOTESAFETY, 1, 1, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_MAKERNOTESAFETY, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 0, 0, "MakerNoteSafety" }, - { TIFFTAG_CALIBRATIONILLUMINANT1, 1, 1, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_CALIBRATIONILLUMINANT1, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 0, 0, "CalibrationIlluminant1" }, - { TIFFTAG_CALIBRATIONILLUMINANT2, 1, 1, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_CALIBRATIONILLUMINANT2, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 0, 0, "CalibrationIlluminant2" }, - { TIFFTAG_RAWDATAUNIQUEID, 16, 16, TIFF_BYTE, FIELD_CUSTOM, + { TIFFTAG_RAWDATAUNIQUEID, 16, 16, TIFF_BYTE, FIELD_CUSTOM, 0, 0, "RawDataUniqueID" }, { TIFFTAG_ORIGINALRAWFILENAME, -1, -1, TIFF_ASCII, FIELD_CUSTOM, 1, 0, "OriginalRawFileName" }, @@ -374,28 +374,28 @@ tiffFieldInfo[] = { 1, 1, "OriginalRawFileName" }, { TIFFTAG_ORIGINALRAWFILEDATA, -1, -1, TIFF_UNDEFINED, FIELD_CUSTOM, 0, 1, "OriginalRawFileData" }, - { TIFFTAG_ACTIVEAREA, 4, 4, TIFF_LONG, FIELD_CUSTOM, + { TIFFTAG_ACTIVEAREA, 4, 4, TIFF_LONG, FIELD_CUSTOM, 0, 0, "ActiveArea" }, - { TIFFTAG_ACTIVEAREA, 4, 4, TIFF_SHORT, FIELD_CUSTOM, + { TIFFTAG_ACTIVEAREA, 4, 4, TIFF_SHORT, FIELD_CUSTOM, 0, 0, "ActiveArea" }, - { TIFFTAG_MASKEDAREAS, -1, -1, TIFF_LONG, FIELD_CUSTOM, + { TIFFTAG_MASKEDAREAS, -1, -1, TIFF_LONG, FIELD_CUSTOM, 0, 1, "MaskedAreas" }, { TIFFTAG_ASSHOTICCPROFILE, -1, -1, TIFF_UNDEFINED, FIELD_CUSTOM, 0, 1, "AsShotICCProfile" }, - { TIFFTAG_ASSHOTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, + { TIFFTAG_ASSHOTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, 0, 1, "AsShotPreProfileMatrix" }, { TIFFTAG_CURRENTICCPROFILE, -1, -1, TIFF_UNDEFINED, FIELD_CUSTOM, 0, 1, "CurrentICCProfile" }, - { TIFFTAG_CURRENTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, + { TIFFTAG_CURRENTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, FIELD_CUSTOM, 0, 1, "CurrentPreProfileMatrix" }, /* end DNG tags */ }; static const TIFFFieldInfo exifFieldInfo[] = { - { EXIFTAG_EXPOSURETIME, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_EXPOSURETIME, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "ExposureTime" }, - { EXIFTAG_FNUMBER, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_FNUMBER, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "FNumber" }, { EXIFTAG_EXPOSUREPROGRAM, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 1, 0, "ExposureProgram" }, @@ -415,17 +415,17 @@ exifFieldInfo[] = { 1, 0, "ComponentsConfiguration" }, { EXIFTAG_COMPRESSEDBITSPERPIXEL, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "CompressedBitsPerPixel" }, - { EXIFTAG_SHUTTERSPEEDVALUE, 1, 1, TIFF_SRATIONAL, FIELD_CUSTOM, + { EXIFTAG_SHUTTERSPEEDVALUE, 1, 1, TIFF_SRATIONAL, FIELD_CUSTOM, 1, 0, "ShutterSpeedValue" }, - { EXIFTAG_APERTUREVALUE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_APERTUREVALUE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "ApertureValue" }, - { EXIFTAG_BRIGHTNESSVALUE, 1, 1, TIFF_SRATIONAL, FIELD_CUSTOM, + { EXIFTAG_BRIGHTNESSVALUE, 1, 1, TIFF_SRATIONAL, FIELD_CUSTOM, 1, 0, "BrightnessValue" }, - { EXIFTAG_EXPOSUREBIASVALUE, 1, 1, TIFF_SRATIONAL, FIELD_CUSTOM, + { EXIFTAG_EXPOSUREBIASVALUE, 1, 1, TIFF_SRATIONAL, FIELD_CUSTOM, 1, 0, "ExposureBiasValue" }, - { EXIFTAG_MAXAPERTUREVALUE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_MAXAPERTUREVALUE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "MaxApertureValue" }, - { EXIFTAG_SUBJECTDISTANCE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_SUBJECTDISTANCE, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "SubjectDistance" }, { EXIFTAG_METERINGMODE, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 1, 0, "MeteringMode" }, @@ -433,7 +433,7 @@ exifFieldInfo[] = { 1, 0, "LightSource" }, { EXIFTAG_FLASH, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 1, 0, "Flash" }, - { EXIFTAG_FOCALLENGTH, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_FOCALLENGTH, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "FocalLength" }, { EXIFTAG_SUBJECTAREA, -1, -1, TIFF_SHORT, FIELD_CUSTOM, 1, 1, "SubjectArea" }, @@ -459,19 +459,19 @@ exifFieldInfo[] = { 1, 0, "PixelYDimension" }, { EXIFTAG_RELATEDSOUNDFILE, 13, 13, TIFF_ASCII, FIELD_CUSTOM, 1, 0, "RelatedSoundFile" }, - { EXIFTAG_FLASHENERGY, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_FLASHENERGY, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "FlashEnergy" }, { EXIFTAG_SPATIALFREQUENCYRESPONSE, -1, -1, TIFF_UNDEFINED, FIELD_CUSTOM, 1, 1, "SpatialFrequencyResponse" }, - { EXIFTAG_FOCALPLANEXRESOLUTION, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_FOCALPLANEXRESOLUTION, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "FocalPlaneXResolution" }, - { EXIFTAG_FOCALPLANEYRESOLUTION, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_FOCALPLANEYRESOLUTION, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "FocalPlaneYResolution" }, { EXIFTAG_FOCALPLANERESOLUTIONUNIT, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 1, 0, "FocalPlaneResolutionUnit" }, { EXIFTAG_SUBJECTLOCATION, 2, 2, TIFF_SHORT, FIELD_CUSTOM, 1, 0, "SubjectLocation" }, - { EXIFTAG_EXPOSUREINDEX, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_EXPOSUREINDEX, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "ExposureIndex" }, { EXIFTAG_SENSINGMETHOD, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 1, 0, "SensingMethod" }, @@ -487,13 +487,13 @@ exifFieldInfo[] = { 1, 0, "ExposureMode" }, { EXIFTAG_WHITEBALANCE, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 1, 0, "WhiteBalance" }, - { EXIFTAG_DIGITALZOOMRATIO, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_DIGITALZOOMRATIO, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "DigitalZoomRatio" }, { EXIFTAG_FOCALLENGTHIN35MMFILM, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 1, 0, "FocalLengthIn35mmFilm" }, { EXIFTAG_SCENECAPTURETYPE, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 1, 0, "SceneCaptureType" }, - { EXIFTAG_GAINCONTROL, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, + { EXIFTAG_GAINCONTROL, 1, 1, TIFF_RATIONAL, FIELD_CUSTOM, 1, 0, "GainControl" }, { EXIFTAG_CONTRAST, 1, 1, TIFF_SHORT, FIELD_CUSTOM, 1, 0, "Contrast" }, @@ -529,16 +529,16 @@ _TIFFSetupFieldInfo(TIFF* tif, const TIFFFieldInfo info[], size_t n) if (tif->tif_fieldinfo) { size_t i; - for (i = 0; i < tif->tif_nfields; i++) + for (i = 0; i < tif->tif_nfields; i++) { TIFFFieldInfo *fld = tif->tif_fieldinfo[i]; - if (fld->field_bit == FIELD_CUSTOM && + if (fld->field_bit == FIELD_CUSTOM && strncmp("Tag ", fld->field_name, 4) == 0) { _TIFFfree(fld->field_name); _TIFFfree(fld); } - } - + } + _TIFFfree(tif->tif_fieldinfo); tif->tif_nfields = 0; } @@ -719,9 +719,9 @@ _TIFFFindFieldInfo(TIFF* tif, ttag_t tag, TIFFDataType dt) key.field_type = dt; ret = (const TIFFFieldInfo **) bsearch(&pkey, - tif->tif_fieldinfo, + tif->tif_fieldinfo, tif->tif_nfields, - sizeof(TIFFFieldInfo *), + sizeof(TIFFFieldInfo *), tagCompare); return (ret) ? (*ret) : NULL; } else for (i = 0, n = tif->tif_nfields; i < n; i++) { @@ -752,7 +752,7 @@ _TIFFFindFieldInfoByName(TIFF* tif, const char *field_name, TIFFDataType dt) key.field_type = dt; ret = (const TIFFFieldInfo **) lfind(&pkey, - tif->tif_fieldinfo, + tif->tif_fieldinfo, &tif->tif_nfields, sizeof(TIFFFieldInfo *), tagNameCompare); @@ -840,7 +840,7 @@ _TIFFCreateAnonFieldInfo(TIFF *tif, ttag_t tag, TIFFDataType field_type) */ sprintf(fld->field_name, "Tag %d", (int) tag); - return fld; + return fld; } /* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/uppsrc/plugin/tif/lib/tif_dirread.c b/uppsrc/plugin/tif/lib/tif_dirread.c index 2d18208b0..2147e335f 100644 --- a/uppsrc/plugin/tif/lib/tif_dirread.c +++ b/uppsrc/plugin/tif/lib/tif_dirread.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -216,7 +216,7 @@ TIFFReadDirectory(TIFF* tif) * * It sure would have been nice if Aldus had really thought * this stuff through carefully. - */ + */ for (dp = dir, n = dircount; n > 0; n--, dp++) { if (tif->tif_flags & TIFF_SWAB) { TIFFSwabArrayOfShort(&dp->tdir_tag, 2); @@ -236,7 +236,7 @@ TIFFReadDirectory(TIFF* tif) if (fix >= tif->tif_nfields || dp->tdir_tag == IGNORE) continue; - + /* * Silicon Beach (at least) writes unordered * directory tags (violating the spec). Handle @@ -368,7 +368,7 @@ TIFFReadDirectory(TIFF* tif) MissingRequired(tif, "ImageLength"); goto bad; } - /* + /* * Setup appropriate structures (by strip or by tile) */ if (!TIFFFieldSet(tif, FIELD_TILEDIMENSIONS)) { @@ -559,7 +559,7 @@ TIFFReadDirectory(TIFF* tif) _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); if (EstimateStripByteCounts(tif, dir, dircount) < 0) goto bad; -/* +/* * Assume we have wrong StripByteCount value (in case of single strip) in * following cases: * - it is equal to zero along with StripOffset; @@ -577,8 +577,8 @@ TIFFReadDirectory(TIFF* tif) td->td_compression == COMPRESSION_NONE && \ td->td_stripbytecount[0] < TIFFScanlineSize(tif) * td->td_imagelength) ) - } else if (td->td_nstrips == 1 - && td->td_stripoffset[0] != 0 + } else if (td->td_nstrips == 1 + && td->td_stripoffset[0] != 0 && BYTECOUNTLOOKSBAD) { /* * XXX: Plexus (and others) sometimes give a value of zero for @@ -688,7 +688,7 @@ bad: return (0); } -/* +/* * Read custom directory from the arbitarry offset. * The code is very similar to TIFFReadDirectory(). */ @@ -838,7 +838,7 @@ TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, (void) TIFFFetchNormalTag(tif, dp); } - + if (dir) _TIFFfree(dir); return 1; @@ -910,7 +910,7 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount) * should begin. Since a strip of data must be contiguous, * it's safe to assume that we've overestimated the amount * of data in the strip and trim this number back accordingly. - */ + */ i--; if (((toff_t)(td->td_stripoffset[i]+td->td_stripbytecount[i])) > filesize) @@ -1442,7 +1442,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp) case TIFF_SLONG: { uint32 v32 = TIFFExtractData(tif, dp->tdir_type, dp->tdir_offset); - ok = (fip->field_passcount ? + ok = (fip->field_passcount ? TIFFSetField(tif, dp->tdir_tag, 1, &v32) : TIFFSetField(tif, dp->tdir_tag, v32)); } @@ -1450,7 +1450,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp) case TIFF_RATIONAL: case TIFF_SRATIONAL: case TIFF_FLOAT: - { float v = (dp->tdir_type == TIFF_FLOAT ? + { float v = (dp->tdir_type == TIFF_FLOAT ? TIFFFetchFloat(tif, dp) : TIFFFetchRational(tif, dp)); ok = (fip->field_passcount ? @@ -1485,7 +1485,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp) #define NITEMS(x) (sizeof (x) / sizeof (x[0])) /* - * Fetch samples/pixel short values for + * Fetch samples/pixel short values for * the specified tag and verify that * all values are the same. */ @@ -1526,7 +1526,7 @@ TIFFFetchPerSampleShorts(TIFF* tif, TIFFDirEntry* dir, uint16* pl) } /* - * Fetch samples/pixel long values for + * Fetch samples/pixel long values for * the specified tag and verify that * all values are the same. */ @@ -1639,7 +1639,7 @@ TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32** lpp) return (0); if( (status = TIFFFetchShortArray(tif, dir, dp)) != 0 ) { int i; - + for( i = 0; i < nstrips && i < (int) dir->tdir_count; i++ ) { lp[i] = dp[i]; @@ -1668,7 +1668,7 @@ TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32** lpp) _TIFFfree( (char *) dp ); } else status = TIFFFetchLongArray(tif, dir, lp); - + return (status); } @@ -1737,7 +1737,7 @@ ChopUpSingleUncompressedStrip(TIFF* tif) else return; - /* + /* * never increase the number of strips in an image */ if (rowsperstrip >= td->td_rowsperstrip) diff --git a/uppsrc/plugin/tif/lib/tif_dirwrite.c b/uppsrc/plugin/tif/lib/tif_dirwrite.c index c87221de0..71681221f 100644 --- a/uppsrc/plugin/tif/lib/tif_dirwrite.c +++ b/uppsrc/plugin/tif/lib/tif_dirwrite.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -179,7 +179,7 @@ _TIFFWriteDirectory(TIFF* tif, int done) /* ** For custom fields, we test to see if the custom field ** is set or not. For normal fields, we just use the - ** FieldSet test. + ** FieldSet test. */ if( fip->field_bit == FIELD_CUSTOM ) { @@ -212,7 +212,7 @@ _TIFFWriteDirectory(TIFF* tif, int done) TIFFTAG_TILEOFFSETS : TIFFTAG_STRIPOFFSETS; if (tag != fip->field_tag) continue; - + dir->tdir_tag = (uint16) tag; dir->tdir_type = (uint16) TIFF_LONG; dir->tdir_count = (uint32) td->td_nstrips; @@ -230,7 +230,7 @@ _TIFFWriteDirectory(TIFF* tif, int done) TIFFTAG_TILEBYTECOUNTS : TIFFTAG_STRIPBYTECOUNTS; if (tag != fip->field_tag) continue; - + dir->tdir_tag = (uint16) tag; dir->tdir_type = (uint16) TIFF_LONG; dir->tdir_count = (uint32) td->td_nstrips; @@ -345,7 +345,7 @@ _TIFFWriteDirectory(TIFF* tif, int done) break; } dir++; - + if( fip->field_bit != FIELD_CUSTOM ) ResetFieldBit(fields, fip->field_bit); } @@ -417,7 +417,7 @@ TIFFWriteDirectory(TIFF* tif) * but leaves all data structures in memory so that it can be * written again. This will make a partially written TIFF file * readable before it is successfully completed/closed. - */ + */ int TIFFCheckpointDirectory(TIFF* tif) { @@ -442,7 +442,7 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip) dir->tdir_tag = (uint16) fip->field_tag; dir->tdir_type = (uint16) fip->field_type; dir->tdir_count = wc; - + switch (fip->field_type) { case TIFF_SHORT: case TIFF_SSHORT: @@ -578,7 +578,7 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip) } break; case TIFF_ASCII: - { + { char* cp; if (fip->field_passcount) TIFFGetField(tif, fip->field_tag, &wc, &cp); @@ -592,7 +592,7 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip) break; case TIFF_BYTE: - case TIFF_SBYTE: + case TIFF_SBYTE: if (fip->field_passcount) { char* cp; if (wc == (uint16) TIFF_VARIABLE2) { @@ -627,7 +627,7 @@ TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip) } else if (wc == (unsigned short) TIFF_VARIABLE2) { TIFFGetField(tif, fip->field_tag, &wc2, &cp); dir->tdir_count = wc2; - } else + } else TIFFGetField(tif, fip->field_tag, &cp); if (!TIFFWriteByteArray(tif, dir, cp)) return (0); @@ -697,7 +697,7 @@ TIFFWritePerSampleShorts(TIFF* tif, ttag_t tag, TIFFDirEntry* dir) TIFFGetField(tif, tag, &v); for (i = 0; i < samples; i++) w[i] = v; - + dir->tdir_tag = (uint16) tag; dir->tdir_type = (uint16) TIFF_SHORT; dir->tdir_count = samples; @@ -925,7 +925,7 @@ TIFFWriteAnyArray(TIFF* tif, switch (type) { case TIFF_BYTE: - { + { uint8* bp = (uint8*) w; for (i = 0; i < (int) n; i++) bp[i] = (uint8) v[i]; @@ -934,7 +934,7 @@ TIFFWriteAnyArray(TIFF* tif, } break; case TIFF_SBYTE: - { + { int8* bp = (int8*) w; for (i = 0; i < (int) n; i++) bp[i] = (int8) v[i]; @@ -952,7 +952,7 @@ TIFFWriteAnyArray(TIFF* tif, } break; case TIFF_SSHORT: - { + { int16* bp = (int16*) w; for (i = 0; i < (int) n; i++) bp[i] = (int16) v[i]; @@ -979,7 +979,7 @@ TIFFWriteAnyArray(TIFF* tif, } break; case TIFF_FLOAT: - { + { float* bp = (float*) w; for (i = 0; i < (int) n; i++) bp[i] = (float) v[i]; @@ -1081,11 +1081,11 @@ TIFFWriteData(TIFF* tif, TIFFDirEntry* dir, char* cp) /* * Similar to TIFFWriteDirectory(), but if the directory has already * been written once, it is relocated to the end of the file, in case it - * has changed in size. Note that this will result in the loss of the - * previously used directory space. - */ + * has changed in size. Note that this will result in the loss of the + * previously used directory space. + */ -int +int TIFFRewriteDirectory( TIFF *tif ) { static const char module[] = "TIFFRewriteDirectory"; @@ -1098,17 +1098,17 @@ TIFFRewriteDirectory( TIFF *tif ) ** Find and zero the pointer to this directory, so that TIFFLinkDirectory ** will cause it to be added after this directories current pre-link. */ - + /* Is it the first directory in the file? */ - if (tif->tif_header.tiff_diroff == tif->tif_diroff) + if (tif->tif_header.tiff_diroff == tif->tif_diroff) { tif->tif_header.tiff_diroff = 0; tif->tif_diroff = 0; TIFFSeekFile(tif, (toff_t)(TIFF_MAGIC_SIZE+TIFF_VERSION_SIZE), SEEK_SET); - if (!WriteOK(tif, &(tif->tif_header.tiff_diroff), - sizeof (tif->tif_diroff))) + if (!WriteOK(tif, &(tif->tif_header.tiff_diroff), + sizeof (tif->tif_diroff))) { TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error updating TIFF header"); return (0); diff --git a/uppsrc/plugin/tif/lib/tif_dumpmode.c b/uppsrc/plugin/tif/lib/tif_dumpmode.c index 8b749fbda..fb21ffe2f 100644 --- a/uppsrc/plugin/tif/lib/tif_dumpmode.c +++ b/uppsrc/plugin/tif/lib/tif_dumpmode.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -46,7 +46,7 @@ DumpModeEncode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s) n = tif->tif_rawdatasize - tif->tif_rawcc; assert( n > 0 ); - + /* * Avoid copy if client has setup raw * data buffer to avoid extra copy. diff --git a/uppsrc/plugin/tif/lib/tif_error.c b/uppsrc/plugin/tif/lib/tif_error.c index 3ac5b5f83..7025080ed 100644 --- a/uppsrc/plugin/tif/lib/tif_error.c +++ b/uppsrc/plugin/tif/lib/tif_error.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -70,3 +70,4 @@ TIFFErrorExt(thandle_t fd, const char* module, const char* fmt, ...) (*_TIFFerrorHandlerExt)(fd, module, fmt, ap); va_end(ap); } + diff --git a/uppsrc/plugin/tif/lib/tif_fax3.c b/uppsrc/plugin/tif/lib/tif_fax3.c index 2d5300383..74c6ba9cc 100644 --- a/uppsrc/plugin/tif/lib/tif_fax3.c +++ b/uppsrc/plugin/tif/lib/tif_fax3.c @@ -4,23 +4,23 @@ * Copyright (c) 1990-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -562,7 +562,7 @@ static const int _msbmask[9] = if (bit == 0) \ _FlushBits(tif); \ } - + /* * Write a variable-length bit-value to * the output stream. Values are @@ -667,7 +667,7 @@ Fax3PutEOL(TIFF* tif) else align = sp->bit - align; code = 0; - tparm=align; + tparm=align; _PutBits(tif, 0, tparm); } } @@ -1069,7 +1069,7 @@ static void Fax3Cleanup(TIFF* tif) { Fax3CodecState* sp = DecoderState(tif); - + assert(sp != 0); tif->tif_tagmethods.vgetfield = sp->b.vgetparent; @@ -1082,7 +1082,7 @@ Fax3Cleanup(TIFF* tif) if (Fax3State(tif)->subaddress) _TIFFfree(Fax3State(tif)->subaddress); - + //Patch by cxl, 08-01-29 if (Fax3State(tif)->faxdcs) _TIFFfree(Fax3State(tif)->faxdcs); @@ -1325,7 +1325,7 @@ InitCCITTFax3(TIFF* tif) sp->vsetparent = tif->tif_tagmethods.vsetfield; tif->tif_tagmethods.vsetfield = Fax3VSetField; /* hook for codec tags */ tif->tif_tagmethods.printdir = Fax3PrintDir; /* hook for codec tags */ - sp->groupoptions = 0; + sp->groupoptions = 0; sp->recvparams = 0; sp->subaddress = NULL; sp->faxdcs = NULL; @@ -1415,7 +1415,7 @@ Fax4Decode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s) #ifdef FAX3_DEBUG if( GetBits(13) != 0x1001 ) fputs( "Bad RTC\n", stderr ); -#endif +#endif ClrBits( 13 ); (*sp->fill)(buf, thisrun, pa, lastx); UNCACHE_STATE(tif, sp); diff --git a/uppsrc/plugin/tif/lib/tif_fax3.h b/uppsrc/plugin/tif/lib/tif_fax3.h index e994de9fa..030632f80 100644 --- a/uppsrc/plugin/tif/lib/tif_fax3.h +++ b/uppsrc/plugin/tif/lib/tif_fax3.h @@ -4,23 +4,23 @@ * Copyright (c) 1990-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ diff --git a/uppsrc/plugin/tif/lib/tif_getimage.c b/uppsrc/plugin/tif/lib/tif_getimage.c index daab839a2..d71c85f4e 100644 --- a/uppsrc/plugin/tif/lib/tif_getimage.c +++ b/uppsrc/plugin/tif/lib/tif_getimage.c @@ -4,23 +4,23 @@ * Copyright (c) 1991-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -41,7 +41,7 @@ static int pickTileSeparateCase(TIFFRGBAImage*); static const char photoTag[] = "PhotometricInterpretation"; -/* +/* * Helper constants used in Orientation tag handling */ #define FLIP_VERTICALLY 0x01 @@ -56,7 +56,7 @@ TIFFDisplay display_sRGB = { { 3.2410F, -1.5374F, -0.4986F }, { -0.9692F, 1.8760F, 0.0416F }, { 0.0556F, -0.2040F, 1.0570F } - }, + }, 100.0F, 100.0F, 100.0F, /* Light o/p for reference white */ 255, 255, 255, /* Pixel values for ref. white */ 1.0F, 1.0F, 1.0F, /* Residual light o/p for black pixel */ @@ -107,7 +107,7 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024]) case PHOTOMETRIC_MINISWHITE: case PHOTOMETRIC_MINISBLACK: case PHOTOMETRIC_PALETTE: - if (td->td_planarconfig == PLANARCONFIG_CONTIG + if (td->td_planarconfig == PLANARCONFIG_CONTIG && td->td_samplesperpixel != 1 && td->td_bitspersample < 8 ) { sprintf(emsg, @@ -121,7 +121,7 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024]) /* ** We should likely validate that any extra samples are either ** to be ignored, or are alpha, and if alpha we should try to use - ** them. But for now we won't bother with this. + ** them. But for now we won't bother with this. */ break; case PHOTOMETRIC_YCBCR: @@ -131,7 +131,7 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024]) return (0); } break; - case PHOTOMETRIC_RGB: + case PHOTOMETRIC_RGB: if (colorchannels < 3) { sprintf(emsg, "Sorry, can not handle RGB image with %s=%d", "Color channels", colorchannels); @@ -236,7 +236,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024]) img->greencmap = NULL; img->bluecmap = NULL; img->req_orientation = ORIENTATION_BOTLEFT; /* It is the default */ - + img->tif = tif; img->stoponerr = stop; TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &img->bitspersample); @@ -271,8 +271,8 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024]) if( !TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &img->photometric)) img->photometric = PHOTOMETRIC_MINISWHITE; - if( extrasamples == 0 - && img->samplesperpixel == 4 + if( extrasamples == 0 + && img->samplesperpixel == 4 && img->photometric == PHOTOMETRIC_RGB ) { img->alpha = EXTRASAMPLE_ASSOCALPHA; @@ -320,11 +320,11 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024]) _TIFFmemcpy( img->redcmap, red_orig, n_color * 2 ); _TIFFmemcpy( img->greencmap, green_orig, n_color * 2 ); _TIFFmemcpy( img->bluecmap, blue_orig, n_color * 2 ); - + /* fall thru... */ case PHOTOMETRIC_MINISWHITE: case PHOTOMETRIC_MINISBLACK: - if (planarconfig == PLANARCONFIG_CONTIG + if (planarconfig == PLANARCONFIG_CONTIG && img->samplesperpixel != 1 && img->bitspersample < 8 ) { sprintf(emsg, @@ -358,7 +358,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024]) break; } break; - case PHOTOMETRIC_RGB: + case PHOTOMETRIC_RGB: if (colorchannels < 3) { sprintf(emsg, "Sorry, can not handle RGB image with %s=%d", "Color channels", colorchannels); @@ -491,7 +491,7 @@ TIFFReadRGBAImage(TIFF* tif, ORIENTATION_BOTLEFT, stop); } -static int +static int setorientation(TIFFRGBAImage* img) { switch (img->orientation) { @@ -557,7 +557,7 @@ setorientation(TIFFRGBAImage* img) * PlanarConfiguration contiguous if SamplesPerPixel > 1 * or * SamplesPerPixel == 1 - */ + */ static int gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) { @@ -589,12 +589,12 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) y = 0; toskew = -(int32)(tw - w); } - + for (row = 0; row < h; row += nrow) { rowstoread = th - (row + img->row_offset) % th; nrow = (row + rowstoread > h ? h - row : rowstoread); - for (col = 0; col < w; col += tw) + for (col = 0; col < w; col += tw) { if (TIFFReadTile(tif, buf, col+img->col_offset, row+img->row_offset, 0, 0) < 0 && img->stoponerr) @@ -602,10 +602,10 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) ret = 0; break; } - + pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif); - if (col + tw > w) + if (col + tw > w) { /* * Tile is clipped horizontally. Calculate @@ -616,7 +616,7 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) (*put)(img, raster+y*w+col, col, y, npix, nrow, fromskew, toskew + fromskew, buf + pos); } - else + else { (*put)(img, raster+y*w+col, col, y, tw, nrow, 0, toskew, buf + pos); } @@ -632,7 +632,7 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) for (line = 0; line < h; line++) { uint32 *left = raster + (line * w); uint32 *right = left + w - 1; - + while ( left < right ) { uint32 temp = *left; *left = *right; @@ -650,7 +650,7 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) * SamplesPerPixel > 1 * PlanarConfiguration separated * We assume that all such images are RGB. - */ + */ static int gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) { @@ -696,11 +696,11 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) toskew = -(int32)(tw - w); } - for (row = 0; row < h; row += nrow) + for (row = 0; row < h; row += nrow) { rowstoread = th - (row + img->row_offset) % th; nrow = (row + rowstoread > h ? h - row : rowstoread); - for (col = 0; col < w; col += tw) + for (col = 0; col < w; col += tw) { if (TIFFReadTile(tif, r, col+img->col_offset, row+img->row_offset,0,0) < 0 && img->stoponerr) @@ -729,7 +729,7 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif); - if (col + tw > w) + if (col + tw > w) { /* * Tile is clipped horizontally. Calculate @@ -738,7 +738,7 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) uint32 npix = w - col; fromskew = tw - npix; (*put)(img, raster+y*w+col, col, y, - npix, nrow, fromskew, toskew + fromskew, + npix, nrow, fromskew, toskew + fromskew, r + pos, g + pos, b + pos, a + pos); } else { (*put)(img, raster+y*w+col, col, y, @@ -755,7 +755,7 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) for (line = 0; line < h; line++) { uint32 *left = raster + (line * w); uint32 *right = left + w - 1; - + while ( left < right ) { uint32 temp = *left; *left = *right; @@ -774,7 +774,7 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) * PlanarConfiguration contiguous if SamplesPerPixel > 1 * or * SamplesPerPixel == 1 - */ + */ static int gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) { @@ -808,13 +808,13 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); scanline = TIFFScanlineSize(tif); fromskew = (w < imagewidth ? imagewidth - w : 0); - for (row = 0; row < h; row += nrow) + for (row = 0; row < h; row += nrow) { rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; nrow = (row + rowstoread > h ? h - row : rowstoread); if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif,row+img->row_offset, 0), - buf, + buf, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 && img->stoponerr) { @@ -833,7 +833,7 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) for (line = 0; line < h; line++) { uint32 *left = raster + (line * w); uint32 *right = left + w - 1; - + while ( left < right ) { uint32 temp = *left; *left = *right; @@ -896,27 +896,27 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); scanline = TIFFScanlineSize(tif); fromskew = (w < imagewidth ? imagewidth - w : 0); - for (row = 0; row < h; row += nrow) + for (row = 0; row < h; row += nrow) { - rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; + rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; nrow = (row + rowstoread > h ? h - row : rowstoread); offset_row = row + img->row_offset; if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0), - r, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 + r, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 && img->stoponerr) { ret = 0; break; } if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 1), - g, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 + g, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 && img->stoponerr) { ret = 0; break; } if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 2), - b, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 + b, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 && img->stoponerr) { ret = 0; @@ -924,7 +924,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) } if (alpha && (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 3), - a, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 + a, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 && img->stoponerr)) { ret = 0; @@ -932,7 +932,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) } pos = ((row + img->row_offset) % rowsperstrip) * scanline; - (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, r + pos, g + pos, + (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, r + pos, g + pos, b + pos, a + pos); y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); } @@ -943,7 +943,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) for (line = 0; line < h; line++) { uint32 *left = raster + (line * w); uint32 *right = left + w - 1; - + while ( left < right ) { uint32 temp = *left; *left = *right; @@ -1012,7 +1012,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) op2; \ } \ } - + #define SKEW(r,g,b,skew) { r += skew; g += skew; b += skew; } #define SKEW4(r,g,b,a,skew) { r += skew; g += skew; b += skew; a+= skew; } @@ -1349,7 +1349,7 @@ DECLAREContigPutFunc(putRGBUAcontig16bittile) * we divide by (0xffff * 0xfff) / 0xff == 0x10eff. */ for (x = w; x-- > 0;) { - a = wp[3] >> 4; + a = wp[3] >> 4; r = (wp[0] * a) / 0x10eff; g = (wp[1] * a) / 0x10eff; b = (wp[2] * a) / 0x10eff; @@ -1544,7 +1544,7 @@ DECLARESepPutFunc(putRGBUAseparate16bittile) * we divide by (0xffff * 0xfff) / 0xff == 0x10eff. */ for (x = w; x-- > 0;) { - a = *wa++ >> 4; + a = *wa++ >> 4; r = (*wr++ * a) / 0x10eff; g = (*wg++ * a) / 0x10eff; b = (*wb++ * a) / 0x10eff; @@ -1591,22 +1591,22 @@ DECLAREContigPutFunc(putcontig8bitCIELab) } /* - * 8-bit packed YCbCr samples => RGB - * This function is generic for different sampling sizes, + * 8-bit packed YCbCr samples => RGB + * This function is generic for different sampling sizes, * and can handle blocks sizes that aren't multiples of the * sampling size. However, it is substantially less optimized * than the specific sampling cases. It is used as a fallback * for difficult blocks. */ #ifdef notdef -static void putcontig8bitYCbCrGenericTile( - TIFFRGBAImage* img, - uint32* cp, - uint32 x, uint32 y, - uint32 w, uint32 h, - int32 fromskew, int32 toskew, +static void putcontig8bitYCbCrGenericTile( + TIFFRGBAImage* img, + uint32* cp, + uint32 x, uint32 y, + uint32 w, uint32 h, + int32 fromskew, int32 toskew, unsigned char* pp, - int h_group, + int h_group, int v_group ) { @@ -1626,9 +1626,9 @@ static void putcontig8bitYCbCrGenericTile( int y_line_group = yy / v_group; int y_remainder = yy - y_line_group * v_group; - pp_line = pp + v_line_group * - + pp_line = pp + v_line_group * + for( xx = 0; xx < w; xx++ ) { Cb = pp @@ -1679,7 +1679,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr44tile) (void) y; /* adjust fromskew */ fromskew = (fromskew * 18) / 4; - if ((h & 3) == 0 && (w & 3) == 0) { + if ((h & 3) == 0 && (w & 3) == 0) { for (; h >= 4; h -= 4) { x = w>>2; do { @@ -1779,7 +1779,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr42tile) do { int32 Cb = pp[8]; int32 Cr = pp[9]; - + YCbCrtoRGB(cp [0], pp[0]); YCbCrtoRGB(cp [1], pp[1]); YCbCrtoRGB(cp [2], pp[2]); @@ -1788,7 +1788,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr42tile) YCbCrtoRGB(cp1[1], pp[5]); YCbCrtoRGB(cp1[2], pp[6]); YCbCrtoRGB(cp1[3], pp[7]); - + cp += 4, cp1 += 4; pp += 10; } while (--x); @@ -1962,7 +1962,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr21tile) int32 Cb = pp[2]; int32 Cr = pp[3]; - YCbCrtoRGB(cp[0], pp[0]); + YCbCrtoRGB(cp[0], pp[0]); YCbCrtoRGB(cp[1], pp[1]); cp += 2; @@ -1973,7 +1973,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr21tile) { int32 Cb = pp[2]; int32 Cr = pp[3]; - + YCbCrtoRGB(cp [0], pp[0]); cp += 1; @@ -1993,7 +1993,7 @@ DECLAREContigPutFunc(putcontig8bitYCbCr11tile) (void) y; fromskew *= 3; do { - x = w; /* was x = w>>1; patched 2000/09/25 warmerda@home.com */ + x = w; /* was x = w>>1; patched 2000/09/25 warmerda@home.com */ do { int32 Cb = pp[1]; int32 Cr = pp[2]; @@ -2154,14 +2154,14 @@ makebwmap(TIFFRGBAImage* img) * Construct a mapping table to convert from the range * of the data samples to [0,255] --for display. This * process also handles inverting B&W images when needed. - */ + */ static int setupMap(TIFFRGBAImage* img) { int32 x, range; range = (int32)((1L<bitspersample)-1); - + /* treat 16 bit the same as eight bit */ if( img->bitspersample == 16 ) range = (int32) 255; @@ -2284,7 +2284,7 @@ makecmap(TIFFRGBAImage* img) return (1); } -/* +/* * Construct any mapping table used * by the associated put routine. */ @@ -2461,7 +2461,7 @@ TIFFReadRGBAStrip(TIFF* tif, uint32 row, uint32 * raster ) "Can't use TIFFReadRGBAStrip() with tiled file."); return (0); } - + TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); if( (row % rowsperstrip) != 0 ) { @@ -2479,15 +2479,15 @@ TIFFReadRGBAStrip(TIFF* tif, uint32 row, uint32 * raster ) rows_to_read = img.height - row; else rows_to_read = rowsperstrip; - + ok = TIFFRGBAImageGet(&img, raster, img.width, rows_to_read ); - + TIFFRGBAImageEnd(&img); } else { TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), emsg); ok = 0; } - + return (ok); } @@ -2512,14 +2512,14 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster) * Verify that our request is legal - on a tile file, and on a * tile boundary. */ - + if( !TIFFIsTiled( tif ) ) { TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Can't use TIFFReadRGBATile() with stripped file."); return (0); } - + TIFFGetFieldDefaulted(tif, TIFFTAG_TILEWIDTH, &tile_xsize); TIFFGetFieldDefaulted(tif, TIFFTAG_TILELENGTH, &tile_ysize); if( (col % tile_xsize) != 0 || (row % tile_ysize) != 0 ) @@ -2533,8 +2533,8 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster) /* * Setup the RGBA reader. */ - - if (!TIFFRGBAImageOK(tif, emsg) + + if (!TIFFRGBAImageOK(tif, emsg) || !TIFFRGBAImageBegin(&img, tif, 0, emsg)) { TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), emsg); return( 0 ); @@ -2551,7 +2551,7 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster) read_ysize = img.height - row; else read_ysize = tile_ysize; - + if( col + tile_xsize > img.width ) read_xsize = img.width - col; else @@ -2560,12 +2560,12 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster) /* * Read the chunk of imagery. */ - + img.row_offset = row; img.col_offset = col; ok = TIFFRGBAImageGet(&img, raster, read_xsize, read_ysize ); - + TIFFRGBAImageEnd(&img); /* @@ -2573,7 +2573,7 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster) * shifting the data around as if a full tile of data is being returned. * * This is all the more complicated because the image is organized in - * bottom to top format. + * bottom to top format. */ if( read_xsize == tile_xsize && read_ysize == tile_ysize ) diff --git a/uppsrc/plugin/tif/lib/tif_jpeg.c b/uppsrc/plugin/tif/lib/tif_jpeg.c index ba6ffe3da..9a63b35ba 100644 --- a/uppsrc/plugin/tif/lib/tif_jpeg.c +++ b/uppsrc/plugin/tif/lib/tif_jpeg.c @@ -4,23 +4,23 @@ * Copyright (c) 1994-1997 Sam Leffler * Copyright (c) 1994-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -726,9 +726,9 @@ JPEGPreDecode(TIFF* tif, tsample_t s) sp->cinfo.d.image_height != segment_height) { TIFFWarningExt(tif->tif_clientdata, module, "Improper JPEG strip/tile size, expected %dx%d, got %dx%d", - segment_width, + segment_width, segment_height, - sp->cinfo.d.image_width, + sp->cinfo.d.image_width, sp->cinfo.d.image_height); } if (sp->cinfo.d.num_components != @@ -863,38 +863,38 @@ JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s) JSAMPROW line_work_buf = NULL; /* - ** For 6B, only use temporary buffer for 12 bit imagery. - ** For Mk1 always use it. + ** For 6B, only use temporary buffer for 12 bit imagery. + ** For Mk1 always use it. */ -#if !defined(JPEG_LIB_MK1) +#if !defined(JPEG_LIB_MK1) if( sp->cinfo.d.data_precision == 12 ) #endif { - line_work_buf = (JSAMPROW) - _TIFFmalloc(sizeof(short) * sp->cinfo.d.output_width + line_work_buf = (JSAMPROW) + _TIFFmalloc(sizeof(short) * sp->cinfo.d.output_width * sp->cinfo.d.num_components ); } do { if( line_work_buf != NULL ) { - /* + /* ** In the MK1 case, we aways read into a 16bit buffer, and then ** pack down to 12bit or 8bit. In 6B case we only read into 16 - ** bit buffer for 12bit data, which we need to repack. + ** bit buffer for 12bit data, which we need to repack. */ if (TIFFjpeg_read_scanlines(sp, &line_work_buf, 1) != 1) return (0); if( sp->cinfo.d.data_precision == 12 ) { - int value_pairs = (sp->cinfo.d.output_width + int value_pairs = (sp->cinfo.d.output_width * sp->cinfo.d.num_components) / 2; int iPair; for( iPair = 0; iPair < value_pairs; iPair++ ) { - unsigned char *out_ptr = + unsigned char *out_ptr = ((unsigned char *) buf) + iPair * 3; JSAMPLE *in_ptr = line_work_buf + iPair * 2; @@ -906,13 +906,13 @@ JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s) } else if( sp->cinfo.d.data_precision == 8 ) { - int value_count = (sp->cinfo.d.output_width + int value_count = (sp->cinfo.d.output_width * sp->cinfo.d.num_components); int iValue; for( iValue = 0; iValue < value_count; iValue++ ) { - ((unsigned char *) buf)[iValue] = + ((unsigned char *) buf)[iValue] = line_work_buf[iValue] & 0xff; } } @@ -920,11 +920,11 @@ JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s) else { /* - ** In the libjpeg6b 8bit case. We read directly into the + ** In the libjpeg6b 8bit case. We read directly into the ** TIFF buffer. */ JSAMPROW bufptr = (JSAMPROW)buf; - + if (TIFFjpeg_read_scanlines(sp, &bufptr, 1) != 1) return (0); } @@ -959,13 +959,13 @@ JPEGDecodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s) /* Cb,Cr both have sampling factors 1, so this is correct */ JDIMENSION clumps_per_line = sp->cinfo.d.comp_info[1].downsampled_width; int samples_per_clump = sp->samplesperclump; - + #ifdef JPEG_LIB_MK1 unsigned short* tmpbuf = _TIFFmalloc(sizeof(unsigned short) * sp->cinfo.d.output_width * sp->cinfo.d.num_components); #endif - + do { jpeg_component_info *compptr; int ci, clumpoffset; @@ -1053,7 +1053,7 @@ JPEGDecodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s) buf += sp->bytesperline; cc -= sp->bytesperline; } while (--nrows > 0); - + #ifdef JPEG_LIB_MK1 _TIFFfree(tmpbuf); #endif @@ -1195,9 +1195,9 @@ JPEGSetupEncode(TIFF* tif) */ #ifdef JPEG_LIB_MK1 /* BITS_IN_JSAMPLE now permits 8 and 12 --- dgilbert */ - if (td->td_bitspersample != 8 && td->td_bitspersample != 12) + if (td->td_bitspersample != 8 && td->td_bitspersample != 12) #else - if (td->td_bitspersample != BITS_IN_JSAMPLE ) + if (td->td_bitspersample != BITS_IN_JSAMPLE ) #endif { TIFFErrorExt(tif->tif_clientdata, module, "BitsPerSample %d not allowed for JPEG", @@ -1520,7 +1520,7 @@ static void JPEGCleanup(TIFF* tif) { JPEGState *sp = JState(tif); - + assert(sp != 0); tif->tif_tagmethods.vgetfield = sp->vgetparent; @@ -1621,18 +1621,18 @@ JPEGVSetField(TIFF* tif, ttag_t tag, va_list ap) * order to get the sampling values from the jpeg data stream. Various * hacks are various places are done to ensure this function gets called * before the td_ycbcrsubsampling values are used from the directory structure, - * including calling TIFFGetField() for the YCBCRSUBSAMPLING field from - * TIFFStripSize(), and the printing code in tif_print.c. + * including calling TIFFGetField() for the YCBCRSUBSAMPLING field from + * TIFFStripSize(), and the printing code in tif_print.c. * * Note that JPEGPreDeocode() will produce a fairly loud warning when the * discovered sampling does not match the default sampling (2,2) or whatever - * was actually in the tiff tags. + * was actually in the tiff tags. * * Problems: * o This code will cause one whole strip/tile of compressed data to be * loaded just to get the tags right, even if the imagery is never read. * It would be more efficient to just load a bit of the header, and - * initialize things from that. + * initialize things from that. * * See the bug in bugzilla for details: * @@ -1641,7 +1641,7 @@ JPEGVSetField(TIFF* tif, ttag_t tag, va_list ap) * Frank Warmerdam, July 2002 */ -static void +static void JPEGFixupTestSubsampling( TIFF * tif ) { #ifdef CHECK_JPEG_YCBCR_SUBSAMPLING @@ -1651,13 +1651,13 @@ JPEGFixupTestSubsampling( TIFF * tif ) JPEGInitializeLibJPEG( tif, 0, 0 ); /* - * Some JPEG-in-TIFF files don't provide the ycbcrsampling tags, + * Some JPEG-in-TIFF files don't provide the ycbcrsampling tags, * and use a sampling schema other than the default 2,2. To handle * this we actually have to scan the header of a strip or tile of - * jpeg data to get the sampling. + * jpeg data to get the sampling. */ - if( !sp->cinfo.comm.is_decompressor - || sp->ycbcrsampling_fetched + if( !sp->cinfo.comm.is_decompressor + || sp->ycbcrsampling_fetched || td->td_photometric != PHOTOMETRIC_YCBCR ) return; @@ -1673,7 +1673,7 @@ JPEGFixupTestSubsampling( TIFF * tif ) return; } - TIFFSetField( tif, TIFFTAG_YCBCRSUBSAMPLING, + TIFFSetField( tif, TIFFTAG_YCBCRSUBSAMPLING, (uint16) sp->h_sampling, (uint16) sp->v_sampling ); #endif /* CHECK_JPEG_YCBCR_SUBSAMPLING */ } @@ -1771,15 +1771,15 @@ JPEGDefaultTileSize(TIFF* tif, uint32* tw, uint32* th) * The JPEG library initialized used to be done in TIFFInitJPEG(), but * now that we allow a TIFF file to be opened in update mode it is necessary * to have some way of deciding whether compression or decompression is - * desired other than looking at tif->tif_mode. We accomplish this by + * desired other than looking at tif->tif_mode. We accomplish this by * examining {TILE/STRIP}BYTECOUNTS to see if there is a non-zero entry. - * If so, we assume decompression is desired. + * If so, we assume decompression is desired. * * This is tricky, because TIFFInitJPEG() is called while the directory is * being read, and generally speaking the BYTECOUNTS tag won't have been read * at that point. So we try to defer jpeg library initialization till we * do have that tag ... basically any access that might require the compressor - * or decompressor that occurs after the reading of the directory. + * or decompressor that occurs after the reading of the directory. * * In an ideal world compressors or decompressors would be setup * at the point where a single tile or strip was accessed (for read or write) @@ -1802,16 +1802,16 @@ static int JPEGInitializeLibJPEG( TIFF * tif, int force_encode, int force_decode /* * Do we have tile data already? Make sure we initialize the * the state in decompressor mode if we have tile data, even if we - * are not in read-only file access mode. + * are not in read-only file access mode. */ - if( TIFFIsTiled( tif ) - && TIFFGetField( tif, TIFFTAG_TILEBYTECOUNTS, &byte_counts ) + if( TIFFIsTiled( tif ) + && TIFFGetField( tif, TIFFTAG_TILEBYTECOUNTS, &byte_counts ) && byte_counts != NULL ) { data_is_empty = byte_counts[0] == 0; } - if( !TIFFIsTiled( tif ) - && TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &byte_counts) + if( !TIFFIsTiled( tif ) + && TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &byte_counts) && byte_counts != NULL ) { data_is_empty = byte_counts[0] == 0; @@ -1914,10 +1914,10 @@ TIFFInitJPEG(TIFF* tif, int scheme) sp->cinfo_initialized = FALSE; /* - ** Create a JPEGTables field if no directory has yet been created. + ** Create a JPEGTables field if no directory has yet been created. ** We do this just to ensure that sufficient space is reserved for ** the JPEGTables field. It will be properly created the right - ** size later. + ** size later. */ if( tif->tif_diroff == 0 ) { diff --git a/uppsrc/plugin/tif/lib/tif_luv.c b/uppsrc/plugin/tif/lib/tif_luv.c index c2a990f2e..eea2d7ea0 100644 --- a/uppsrc/plugin/tif/lib/tif_luv.c +++ b/uppsrc/plugin/tif/lib/tif_luv.c @@ -4,23 +4,23 @@ * Copyright (c) 1997 Greg Ward Larson * Copyright (c) 1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler, Greg Larson and Silicon Graphics may not be used in any * advertising or publicity relating to the software without the specific, * prior written permission of Sam Leffler, Greg Larson and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER, GREG LARSON OR SILICON GRAPHICS BE LIABLE * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -36,7 +36,7 @@ * LogLuv image support uses the TIFF library to store 16 or 10-bit * log luminance values with 8 bits each of u and v or a 14-bit index. * - * The codec can take as input and produce as output 32-bit IEEE float values + * The codec can take as input and produce as output 32-bit IEEE float values * as well as 16-bit integer values. A 16-bit luminance is interpreted * as a sign bit followed by a 15-bit integer that is converted * to and from a linear magnitude using the transformation: @@ -760,7 +760,7 @@ oog_encode(double u, double v) /* encode out-of-gamut chroma */ static int oog_table[NANGLES]; static int initialized = 0; register int i; - + if (!initialized) { /* set up perimeter table */ double eps[NANGLES], ua, va, ang, epsa; int ui, vi, ustep; diff --git a/uppsrc/plugin/tif/lib/tif_lzw.c b/uppsrc/plugin/tif/lib/tif_lzw.c index 2f3698009..1c7b796df 100644 --- a/uppsrc/plugin/tif/lib/tif_lzw.c +++ b/uppsrc/plugin/tif/lib/tif_lzw.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -198,7 +198,7 @@ LZWSetupDecode(TIFF* tif) if( sp == NULL ) { /* - * Allocate state block so tag methods have storage to record + * Allocate state block so tag methods have storage to record * values. */ tif->tif_data = (tidata_t) _TIFFmalloc(sizeof(LZWCodecState)); @@ -210,7 +210,7 @@ LZWSetupDecode(TIFF* tif) DecoderState(tif)->dec_codetab = NULL; DecoderState(tif)->dec_decode = NULL; - + /* * Setup predictor setup. */ @@ -218,7 +218,7 @@ LZWSetupDecode(TIFF* tif) sp = DecoderState(tif); } - + assert(sp != NULL); if (sp->dec_codetab == NULL) { @@ -459,7 +459,7 @@ LZWDecode(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s) TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "LZWDecode: Wrong length of decoded string: " "data probably corrupted at scanline %d", - tif->tif_row); + tif->tif_row); return (0); } if (codep->length > occ) { @@ -655,7 +655,7 @@ LZWDecodeCompat(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s) TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "LZWDecodeCompat: Wrong length of decoded " "string: data probably corrupted at scanline %d", - tif->tif_row); + tif->tif_row); return (0); } if (codep->length > occ) { @@ -775,16 +775,16 @@ LZWPreEncode(TIFF* tif, tsample_t s) /* * Encode a chunk of pixels. * - * Uses an open addressing double hashing (no chaining) on the + * Uses an open addressing double hashing (no chaining) on the * prefix code/next character combination. We do a variant of * Knuth's algorithm D (vol. 3, sec. 6.4) along with G. Knott's * relatively-prime secondary probe. Here, the modular division - * first probe is gives way to a faster exclusive-or manipulation. + * first probe is gives way to a faster exclusive-or manipulation. * Also do block compression with an adaptive reset, whereby the * code table is cleared when the compression ratio decreases, * but after the table fills. The variable-length output codes * are re-sized at this point, and a CODE_CLEAR is generated - * for the decoder. + * for the decoder. */ static int LZWEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) @@ -968,7 +968,7 @@ LZWPostEncode(TIFF* tif) sp->enc_oldcode = (hcode_t) -1; } PutNextCode(op, CODE_EOI); - if (nextbits > 0) + if (nextbits > 0) *op++ = (unsigned char)(nextdata << (8-nextbits)); tif->tif_rawcc = (tsize_t)(op - tif->tif_rawdata); return (1); @@ -1054,7 +1054,7 @@ TIFFInitLZW(TIFF* tif, int scheme) (void) TIFFPredictorInit(tif); return (1); bad: - TIFFErrorExt(tif->tif_clientdata, "TIFFInitLZW", + TIFFErrorExt(tif->tif_clientdata, "TIFFInitLZW", "No space for LZW state block"); return (0); } diff --git a/uppsrc/plugin/tif/lib/tif_msdos.c b/uppsrc/plugin/tif/lib/tif_msdos.c index 27bdb4f35..de1c4bb9d 100644 --- a/uppsrc/plugin/tif/lib/tif_msdos.c +++ b/uppsrc/plugin/tif/lib/tif_msdos.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -33,7 +33,7 @@ #endif #include "tiffiop.h" -static tsize_t +static tsize_t _tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) { return (read((int) fd, buf, size)); diff --git a/uppsrc/plugin/tif/lib/tif_next.c b/uppsrc/plugin/tif/lib/tif_next.c index 55f5b0de8..81528cb9d 100644 --- a/uppsrc/plugin/tif/lib/tif_next.c +++ b/uppsrc/plugin/tif/lib/tif_next.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ diff --git a/uppsrc/plugin/tif/lib/tif_ojpeg.c b/uppsrc/plugin/tif/lib/tif_ojpeg.c index 2932acd52..40bc5735c 100644 --- a/uppsrc/plugin/tif/lib/tif_ojpeg.c +++ b/uppsrc/plugin/tif/lib/tif_ojpeg.c @@ -51,7 +51,7 @@ entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; } } -+ ++ + /* + * BEWARE OF KLUDGE: This subroutine is a hack for decoding illegal JPEG-in- + * TIFF encapsulations produced by Microsoft's Wang Imaging @@ -77,7 +77,7 @@ + jpeg_reset_huff_decode (register j_decompress_ptr cinfo) + { register huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; + register int ci = 0; -+ ++ + /* Discard encoded input bits, up to the next Byte boundary */ + entropy->bitstate.bits_left &= ~7; + /* Re-initialize DC predictions to 0 */ @@ -94,7 +94,7 @@ entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; } } -+ ++ + /* + * BEWARE OF KLUDGE: This subroutine is a hack for decoding illegal JPEG-in- + * TIFF encapsulations produced by Microsoft's Wang Imaging @@ -121,7 +121,7 @@ + { register shuff_entropy_ptr entropy = (shuff_entropy_ptr) + ((j_lossy_d_ptr)cinfo->codec)->entropy_private; + register int ci = 0; -+ ++ + /* Discard encoded input bits, up to the next Byte boundary */ + entropy->bitstate.bits_left &= ~7; + /* Re-initialize DC predictions to 0 */ @@ -739,7 +739,7 @@ OJPEGSetupEncode(register TIFF *tif) if (!TIFFFieldSet(tif,FIELD_REFBLACKWHITE)) { float refbw[6]; long top = 1L << td->td_bitspersample; - + refbw[0] = 0; refbw[1] = (float)(top-1L); refbw[2] = (float)(top>>1); @@ -874,7 +874,7 @@ OJPEGSetupEncode(register TIFF *tif) && CALLVJPEG(sp,jpeg_write_tables(&sp->cinfo.c)) ) { - + /* Mark the field "present". We can't use "TIFFSetField()" because "BEENWRITING" is already set! */ @@ -929,9 +929,9 @@ OJPEGPreEncode(register TIFF *tif,tsample_t s) sp->cinfo.c.comp_info[0].ac_tbl_no = 1; sp->cinfo.c.comp_info[0].h_samp_factor = sp->h_sampling; sp->cinfo.c.comp_info[0].v_samp_factor = sp->v_sampling; - + /* Scale expected strip/tile size to match a downsampled component. */ - + sp->cinfo.c.image_width = TIFFhowmany(segment_width,sp->h_sampling); sp->cinfo.c.image_height=TIFFhowmany(segment_height,sp->v_sampling); }; @@ -1570,7 +1570,7 @@ OJPEGSetupDecode(register TIFF *tif) != JPEG_HEADER_OK ) return 0; if ( sp->cinfo.d.image_width != segment_width - || sp->cinfo.d.image_height != td->td_imagelength + || sp->cinfo.d.image_height != td->td_imagelength ) { TIFFError(module,"Improper JPEG strip/tile size"); @@ -2069,7 +2069,7 @@ OJPEGVSetField(register TIFF *tif,ttag_t tag,va_list ap) if (v32) { sp->cinfo.d.Ss = *va_arg(ap,uint16 *); - sp->jpeglosslesspredictors = + sp->jpeglosslesspredictors = _TIFFmalloc(sp->jpeglosslesspredictors_length * sizeof(uint16)); if(sp->jpeglosslesspredictors==NULL){return(0);} @@ -2177,7 +2177,7 @@ OJPEGVSetField(register TIFF *tif,ttag_t tag,va_list ap) if(sp->jpegdctables==NULL){return(0);} tiffoff = TIFFSeekFile(tif, 0, SEEK_CUR); bufoff=0; - code_count=0; + code_count=0; for(i2=0;i2jpegdctables_length;i2++){ TIFFSeekFile(tif, v[i2], SEEK_SET); TIFFReadFile(tif, @@ -2201,7 +2201,7 @@ OJPEGVSetField(register TIFF *tif,ttag_t tag,va_list ap) if(sp->jpegactables==NULL){return(0);} tiffoff = TIFFSeekFile(tif, 0, SEEK_CUR); bufoff=0; - code_count=0; + code_count=0; for(i2=0;i2jpegactables_length;i2++){ TIFFSeekFile(tif, v[i2], SEEK_SET); TIFFReadFile(tif, &(((unsigned char*)(sp->jpegactables))[bufoff]), 16); @@ -2367,7 +2367,7 @@ OJPEGVGetField(register TIFF *tif,ttag_t tag,va_list ap) *va_arg(ap, void**)=sp->jpegdctables; return(1); break; - case TIFFTAG_JPEGACTABLES : + case TIFFTAG_JPEGACTABLES : *va_arg(ap, uint32*)=sp->jpegactables_length; *va_arg(ap, void**)=sp->jpegactables; return(1); diff --git a/uppsrc/plugin/tif/lib/tif_open.c b/uppsrc/plugin/tif/lib/tif_open.c index 205820ee6..c6e8b6456 100644 --- a/uppsrc/plugin/tif/lib/tif_open.c +++ b/uppsrc/plugin/tif/lib/tif_open.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -327,14 +327,14 @@ TIFFClientOpen( /* - * The doc for "fopen" for some STD_C_LIBs says that if you - * open a file for modify ("+"), then you must fseek (or + * The doc for "fopen" for some STD_C_LIBs says that if you + * open a file for modify ("+"), then you must fseek (or * fflush?) between any freads and fwrites. This is not * necessary on most systems, but has been shown to be needed - * on Solaris. + * on Solaris. */ TIFFSeekFile( tif, 0, SEEK_SET ); - + if (!WriteOK(tif, &tif->tif_header, sizeof (TIFFHeader))) { TIFFErrorExt(tif->tif_clientdata, name, "Error writing TIFF header"); goto bad; @@ -398,7 +398,7 @@ TIFFClientOpen( TIFFErrorExt(tif->tif_clientdata, name, "Not a TIFF file, bad version number %d (0x%x)", tif->tif_header.tiff_version, - tif->tif_header.tiff_version); + tif->tif_header.tiff_version); goto bad; } tif->tif_flags |= TIFF_MYBUFFER; diff --git a/uppsrc/plugin/tif/lib/tif_packbits.c b/uppsrc/plugin/tif/lib/tif_packbits.c index 77edce55a..0225b3e61 100644 --- a/uppsrc/plugin/tif/lib/tif_packbits.c +++ b/uppsrc/plugin/tif/lib/tif_packbits.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -202,7 +202,7 @@ PackBitsEncodeChunk(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) while ((long)cc > 0) { int chunk = rowsize; - + if( cc < chunk ) chunk = cc; diff --git a/uppsrc/plugin/tif/lib/tif_pixarlog.c b/uppsrc/plugin/tif/lib/tif_pixarlog.c index 97a2de0d7..953342a53 100644 --- a/uppsrc/plugin/tif/lib/tif_pixarlog.c +++ b/uppsrc/plugin/tif/lib/tif_pixarlog.c @@ -4,23 +4,23 @@ * Copyright (c) 1996-1997 Sam Leffler * Copyright (c) 1996 Pixar * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Pixar, Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Pixar, Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL PIXAR, SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -34,10 +34,10 @@ * Contributed by Dan McCoy. * * PixarLog film support uses the TIFF library to store companded - * 11 bit values into a tiff file, which are compressed using the - * zip compressor. + * 11 bit values into a tiff file, which are compressed using the + * zip compressor. * - * The codec can take as input and produce as output 32-bit IEEE float values + * The codec can take as input and produce as output 32-bit IEEE float values * as well as 16-bit or 8-bit unsigned integer values. * * On writing any of the above are converted into the internal @@ -51,7 +51,7 @@ * than the human eye can perceive with extra room to allow for * error introduced by further image computation. As with any quantized * color format, it is possible to perform image calculations which - * expose the quantization error. This format should certainly be less + * expose the quantization error. This format should certainly be less * susceptable to such errors than standard 8-bit encodings, but more * susceptable than straight 16-bit or 32-bit encodings. * @@ -83,7 +83,7 @@ * The codec also handle byte swapping the encoded values as necessary * since the library does not have the information necessary * to know the bit depth of the raw unencoded buffer. - * + * */ #include "tif_predict.h" @@ -108,7 +108,7 @@ static float LogK1, LogK2; #define REPEAT(n, op) { int i; i=n; do { i--; op; } while (i>0); } static void -horizontalAccumulateF(uint16 *wp, int n, int stride, float *op, +horizontalAccumulateF(uint16 *wp, int n, int stride, float *op, float *ToLinearF) { register unsigned int cr, cg, cb, ca, mask; @@ -286,7 +286,7 @@ horizontalAccumulate16(uint16 *wp, int n, int stride, uint16 *op, } } -/* +/* * Returns the log encoded 11-bit values with the horizontal * differencing undone. */ @@ -320,7 +320,7 @@ horizontalAccumulate11(uint16 *wp, int n, int stride, uint16 *op) op[1] = (cg += wp[1]) & mask; op[2] = (cb += wp[2]) & mask; op[3] = (ca += wp[3]) & mask; - } + } } else { REPEAT(stride, *op = *wp&mask; wp++; op++) n -= stride; @@ -454,7 +454,7 @@ horizontalAccumulate8abgr(uint16 *wp, int n, int stride, unsigned char *op, typedef struct { TIFFPredictorState predict; z_stream stream; - uint16 *tbuf; + uint16 *tbuf; uint16 stride; int state; int user_datafmt; @@ -470,7 +470,7 @@ typedef struct { uint16 *FromLT2; uint16 *From14; /* Really for 16-bit data, but we shift down 2 */ uint16 *From8; - + } PixarLogState; static int @@ -483,7 +483,7 @@ PixarLogMakeTables(PixarLogState *sp) * 11-bit companded representation. The 11-bit representation has two * distinct regions. A linear bottom end up through .018316 in steps * of about .000073, and a region of constant ratio up to about 25. - * These floating point numbers are stored in the main table ToLinearF. + * These floating point numbers are stored in the main table ToLinearF. * All other tables are derived from this one. The tables (and the * ratios) are continuous at the internal seam. */ @@ -498,7 +498,7 @@ PixarLogMakeTables(PixarLogState *sp) uint16 *From14; /* Really for 16-bit data, but we shift down 2 */ uint16 *From8; - c = log(RATIO); + c = log(RATIO); nlin = (int)(1./c); /* nlin must be an integer */ c = 1./nlin; b = exp(-c*ONE); /* multiplicative scale factor [b*exp(c*ONE) = 1] */ @@ -671,7 +671,7 @@ PixarLogSetupDecode(TIFF* tif) sp->user_datafmt = PixarLogGuessDataFmt(td); if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) { TIFFErrorExt(tif->tif_clientdata, module, - "PixarLog compression can't handle bits depth/data format combination (depth: %d)", + "PixarLog compression can't handle bits depth/data format combination (depth: %d)", td->td_bitspersample); return (0); } @@ -802,7 +802,7 @@ PixarLogDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s) break; default: TIFFErrorExt(tif->tif_clientdata, tif->tif_name, - "PixarLogDecode: unsupported bits/sample: %d", + "PixarLogDecode: unsupported bits/sample: %d", td->td_bitspersample); return (0); } @@ -922,7 +922,7 @@ horizontalDifferenceF(float *ip, int n, int stride, uint16 *wp, uint16 *FromLT2) } static void -horizontalDifference16(unsigned short *ip, int n, int stride, +horizontalDifference16(unsigned short *ip, int n, int stride, unsigned short *wp, uint16 *From14) { register int r1, g1, b1, a1, r2, g2, b2, a2, mask; @@ -976,7 +976,7 @@ horizontalDifference16(unsigned short *ip, int n, int stride, static void -horizontalDifference8(unsigned char *ip, int n, int stride, +horizontalDifference8(unsigned char *ip, int n, int stride, unsigned short *wp, uint16 *From8) { register int r1, g1, b1, a1, r2, g2, b2, a2, mask; @@ -1066,17 +1066,17 @@ PixarLogEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) for (i = 0, up = sp->tbuf; i < n; i += llen, up += llen) { switch (sp->user_datafmt) { case PIXARLOGDATAFMT_FLOAT: - horizontalDifferenceF((float *)bp, llen, + horizontalDifferenceF((float *)bp, llen, sp->stride, up, sp->FromLT2); bp += llen * sizeof(float); break; case PIXARLOGDATAFMT_16BIT: - horizontalDifference16((uint16 *)bp, llen, + horizontalDifference16((uint16 *)bp, llen, sp->stride, up, sp->From14); bp += llen * sizeof(uint16); break; case PIXARLOGDATAFMT_8BIT: - horizontalDifference8((unsigned char *)bp, llen, + horizontalDifference8((unsigned char *)bp, llen, sp->stride, up, sp->From8); bp += llen * sizeof(unsigned char); break; @@ -1087,7 +1087,7 @@ PixarLogEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) return 0; } } - + sp->stream.next_in = (unsigned char *) sp->tbuf; sp->stream.avail_in = n * sizeof(uint16); @@ -1321,13 +1321,13 @@ TIFFInitPixarLog(TIFF* tif, int scheme) sp->quality = Z_DEFAULT_COMPRESSION; /* default comp. level */ sp->state = 0; - /* we don't wish to use the predictor, + /* we don't wish to use the predictor, * the default is none, which predictor value 1 */ (void) TIFFPredictorInit(tif); /* - * build the companding tables + * build the companding tables */ PixarLogMakeTables(sp); diff --git a/uppsrc/plugin/tif/lib/tif_predict.c b/uppsrc/plugin/tif/lib/tif_predict.c index 5c848c8dc..d3e604d5d 100644 --- a/uppsrc/plugin/tif/lib/tif_predict.c +++ b/uppsrc/plugin/tif/lib/tif_predict.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -187,7 +187,7 @@ PredictorSetupEncode(TIFF* tif) sp->codetile = tif->tif_encodetile; tif->tif_encodetile = PredictorEncodeTile; } - + else if (sp->predictor == 3) { sp->pfunc = fpDiff; /* diff --git a/uppsrc/plugin/tif/lib/tif_predict.h b/uppsrc/plugin/tif/lib/tif_predict.h index d9405321b..ecc7c1b42 100644 --- a/uppsrc/plugin/tif/lib/tif_predict.h +++ b/uppsrc/plugin/tif/lib/tif_predict.h @@ -4,23 +4,23 @@ * Copyright (c) 1995-1997 Sam Leffler * Copyright (c) 1995-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ diff --git a/uppsrc/plugin/tif/lib/tif_print.c b/uppsrc/plugin/tif/lib/tif_print.c index b60ac2230..7b8383c2d 100644 --- a/uppsrc/plugin/tif/lib/tif_print.c +++ b/uppsrc/plugin/tif/lib/tif_print.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -65,7 +65,7 @@ _TIFFPrintField(FILE* fd, const TIFFFieldInfo *fip, uint32 value_count, void *raw_data) { uint32 j; - + fprintf(fd, " %s: ", fip->field_name); for(j = 0; j < value_count; j++) { @@ -153,7 +153,7 @@ _TIFFPrettyPrintField(TIFF* tif, FILE* fd, ttag_t tag, case TIFFTAG_XMLPACKET: { uint32 i; - + fprintf(fd, " XMLPacket (XMP Metadata):\n" ); for(i = 0; i < value_count; i++) fputc(((char *)raw_data)[i], fd); @@ -393,7 +393,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) */ uint16 subsampling[2]; - TIFFGetField( tif, TIFFTAG_YCBCRSUBSAMPLING, + TIFFGetField( tif, TIFFTAG_YCBCRSUBSAMPLING, subsampling + 0, subsampling + 1 ); fprintf(fd, " YCbCr Subsampling: %u, %u\n", subsampling[0], subsampling[1] ); @@ -552,7 +552,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) continue; } } else { - /* + /* * XXX: Should be fixed and removed, see the * notes related to TIFFTAG_PAGENUMBER, * TIFFTAG_HALFTONEHINTS, @@ -590,7 +590,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) _TIFFfree(raw_data); } } - + if (tif->tif_tagmethods.printdir) (*tif->tif_tagmethods.printdir)(tif, fd, flags); if ((flags & TIFFPRINT_STRIPS) && diff --git a/uppsrc/plugin/tif/lib/tif_read.c b/uppsrc/plugin/tif/lib/tif_read.c index b993a8912..c7d1fba7d 100644 --- a/uppsrc/plugin/tif/lib/tif_read.c +++ b/uppsrc/plugin/tif/lib/tif_read.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -155,8 +155,8 @@ TIFFReadEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size) size = stripsize; else if (size > stripsize) size = stripsize; - if (TIFFFillStrip(tif, strip) - && (*tif->tif_decodestrip)(tif, (tidata_t) buf, size, + if (TIFFFillStrip(tif, strip) + && (*tif->tif_decodestrip)(tif, (tidata_t) buf, size, (tsample_t)(strip / td->td_stripsperimage)) > 0 ) { (*tif->tif_postdecode)(tif, (tidata_t) buf, size); return (size); @@ -237,7 +237,7 @@ TIFFReadRawStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size) } /* - * Read the specified strip and setup for decoding. + * Read the specified strip and setup for decoding. * The data buffer is expanded, as necessary, to * hold the strip's data. */ @@ -435,7 +435,7 @@ TIFFReadRawTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_t size) } /* - * Read the specified tile and setup for decoding. + * Read the specified tile and setup for decoding. * The data buffer is expanded, as necessary, to * hold the tile's data. */ diff --git a/uppsrc/plugin/tif/lib/tif_stream.cxx b/uppsrc/plugin/tif/lib/tif_stream.cxx index 75c7a33da..a356d8ece 100644 --- a/uppsrc/plugin/tif/lib/tif_stream.cxx +++ b/uppsrc/plugin/tif/lib/tif_stream.cxx @@ -4,23 +4,23 @@ * Copyright (c) 1988-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -128,13 +128,13 @@ _tiffosSeekProc(thandle_t fd, toff_t off, int whence) break; } // restore original stream state - os->clear(old_state); + os->clear(old_state); // only do something if desired seek position is valid if( origin + off > data->myStreamStartPos ) { toff_t num_fill; - // clear the fail bit + // clear the fail bit os->clear(os->rdstate() & ~ios::failbit); // extend the stream to the expected size diff --git a/uppsrc/plugin/tif/lib/tif_strip.c b/uppsrc/plugin/tif/lib/tif_strip.c index 647ee3121..78854d104 100644 --- a/uppsrc/plugin/tif/lib/tif_strip.c +++ b/uppsrc/plugin/tif/lib/tif_strip.c @@ -4,23 +4,23 @@ * Copyright (c) 1991-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -124,8 +124,8 @@ TIFFVStripSize(TIFF* tif, uint32 nrows) uint16 ycbcrsubsampling[2]; tsize_t w, scanline, samplingarea; - TIFFGetField( tif, TIFFTAG_YCBCRSUBSAMPLING, - ycbcrsubsampling + 0, + TIFFGetField( tif, TIFFTAG_YCBCRSUBSAMPLING, + ycbcrsubsampling + 0, ycbcrsubsampling + 1 ); samplingarea = ycbcrsubsampling[0]*ycbcrsubsampling[1]; @@ -228,13 +228,13 @@ TIFFScanlineSize(TIFF* tif) { TIFFDirectory *td = &tif->tif_dir; tsize_t scanline; - + if (td->td_planarconfig == PLANARCONFIG_CONTIG) { if (td->td_photometric == PHOTOMETRIC_YCBCR && !isUpSampled(tif)) { uint16 ycbcrsubsampling[2]; - TIFFGetField(tif, TIFFTAG_YCBCRSUBSAMPLING, + TIFFGetField(tif, TIFFTAG_YCBCRSUBSAMPLING, ycbcrsubsampling + 0, ycbcrsubsampling + 1); @@ -278,7 +278,7 @@ TIFFRasterScanlineSize(TIFF* tif) { TIFFDirectory *td = &tif->tif_dir; tsize_t scanline; - + scanline = multiply (tif, td->td_bitspersample, td->td_imagewidth, "TIFFRasterScanlineSize"); if (td->td_planarconfig == PLANARCONFIG_CONTIG) { diff --git a/uppsrc/plugin/tif/lib/tif_swab.c b/uppsrc/plugin/tif/lib/tif_swab.c index a72da455e..97cc88825 100644 --- a/uppsrc/plugin/tif/lib/tif_swab.c +++ b/uppsrc/plugin/tif/lib/tif_swab.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -174,38 +174,38 @@ static const unsigned char TIFFBitRevTable[256] = { 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff }; static const unsigned char TIFFNoBitRevTable[256] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, }; const unsigned char* diff --git a/uppsrc/plugin/tif/lib/tif_thunder.c b/uppsrc/plugin/tif/lib/tif_thunder.c index f2096e12f..94496eccb 100644 --- a/uppsrc/plugin/tif/lib/tif_thunder.c +++ b/uppsrc/plugin/tif/lib/tif_thunder.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -134,7 +134,7 @@ static int ThunderDecodeRow(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s) { tidata_t row = buf; - + (void) s; while ((long)occ > 0) { if (!ThunderDecode(tif, row, tif->tif_dir.td_imagewidth)) diff --git a/uppsrc/plugin/tif/lib/tif_tile.c b/uppsrc/plugin/tif/lib/tif_tile.c index c8935a3a0..454fe5cd2 100644 --- a/uppsrc/plugin/tif/lib/tif_tile.c +++ b/uppsrc/plugin/tif/lib/tif_tile.c @@ -4,23 +4,23 @@ * Copyright (c) 1991-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -82,11 +82,11 @@ TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, tsample_t s) if (dz == (uint32) -1) dz = td->td_imagedepth; if (dx != 0 && dy != 0 && dz != 0) { - uint32 xpt = TIFFhowmany(td->td_imagewidth, dx); - uint32 ypt = TIFFhowmany(td->td_imagelength, dy); - uint32 zpt = TIFFhowmany(td->td_imagedepth, dz); + uint32 xpt = TIFFhowmany(td->td_imagewidth, dx); + uint32 ypt = TIFFhowmany(td->td_imagelength, dy); + uint32 zpt = TIFFhowmany(td->td_imagedepth, dz); - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) tile = (xpt*ypt*zpt)*s + (xpt*ypt)*(z/dz) + xpt*(y/dy) + @@ -175,7 +175,7 @@ TIFFTileRowSize(TIFF* tif) { TIFFDirectory *td = &tif->tif_dir; tsize_t rowsize; - + if (td->td_tilelength == 0 || td->td_tilewidth == 0) return ((tsize_t) 0); rowsize = multiply(tif, td->td_bitspersample, td->td_tilewidth, diff --git a/uppsrc/plugin/tif/lib/tif_unix.c b/uppsrc/plugin/tif/lib/tif_unix.c index 6ef4d11c0..28de5c9fe 100644 --- a/uppsrc/plugin/tif/lib/tif_unix.c +++ b/uppsrc/plugin/tif/lib/tif_unix.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -160,11 +160,11 @@ TIFFOpen(const char* name, const char* mode) if (m == -1) return ((TIFF*)0); -/* for cygwin and mingw */ +/* for cygwin and mingw */ #ifdef O_BINARY m |= O_BINARY; -#endif - +#endif + #ifdef _AM29K fd = open(name, m); #else @@ -199,11 +199,11 @@ TIFFOpenW(const wchar_t* name, const char* mode) if (m == -1) return ((TIFF*)0); -/* for cygwin and mingw */ +/* for cygwin and mingw */ #ifdef O_BINARY m |= O_BINARY; -#endif - +#endif + fd = _wopen(name, m, 0666); if (fd < 0) { TIFFErrorExt(0, module, "%s: Cannot open", name); @@ -226,9 +226,9 @@ TIFFOpenW(const wchar_t* name, const char* mode) tif = TIFFFdOpen((int)fd, (mbname != NULL) ? mbname : "", mode); - + _TIFFfree(mbname); - + if(!tif) close(fd); return tif; diff --git a/uppsrc/plugin/tif/lib/tif_warning.c b/uppsrc/plugin/tif/lib/tif_warning.c index 0c63535ba..d593469d2 100644 --- a/uppsrc/plugin/tif/lib/tif_warning.c +++ b/uppsrc/plugin/tif/lib/tif_warning.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -70,3 +70,5 @@ TIFFWarningExt(thandle_t fd, const char* module, const char* fmt, ...) (*_TIFFwarningHandlerExt)(fd, module, fmt, ap); va_end(ap); } + + diff --git a/uppsrc/plugin/tif/lib/tif_win3.c b/uppsrc/plugin/tif/lib/tif_win3.c index 1df8842ba..b16b214da 100644 --- a/uppsrc/plugin/tif/lib/tif_win3.c +++ b/uppsrc/plugin/tif/lib/tif_win3.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -36,7 +36,7 @@ #include #include -static tsize_t +static tsize_t _tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) { return (_hread(fd, buf, size)); diff --git a/uppsrc/plugin/tif/lib/tif_win32.c b/uppsrc/plugin/tif/lib/tif_win32.c index fa4349896..b0db116ff 100644 --- a/uppsrc/plugin/tif/lib/tif_win32.c +++ b/uppsrc/plugin/tif/lib/tif_win32.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -56,7 +56,7 @@ _tiffSeekProc(thandle_t fd, toff_t off, int whence) /* we use this as a special code, so avoid accepting it */ if( off == 0xFFFFFFFF ) return 0xFFFFFFFF; - + switch(whence) { case SEEK_SET: @@ -358,7 +358,7 @@ Win32WarningHandler(const char* module, const char* fmt, va_list ap) fprintf(stderr, "Warning, "); vfprintf(stderr, fmt, ap); fprintf(stderr, ".\n"); -#endif +#endif } TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler; @@ -385,7 +385,7 @@ Win32ErrorHandler(const char* module, const char* fmt, va_list ap) fprintf(stderr, "%s: ", module); vfprintf(stderr, fmt, ap); fprintf(stderr, ".\n"); -#endif +#endif } TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler; diff --git a/uppsrc/plugin/tif/lib/tif_write.c b/uppsrc/plugin/tif/lib/tif_write.c index ca8cda309..e34cfabbd 100644 --- a/uppsrc/plugin/tif/lib/tif_write.c +++ b/uppsrc/plugin/tif/lib/tif_write.c @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -120,7 +120,7 @@ TIFFWriteScanline(TIFF* tif, tdata_t buf, uint32 row, tsample_t sample) return (-1); tif->tif_flags |= TIFF_CODERSETUP; } - + tif->tif_rawcc = 0; tif->tif_rawcp = tif->tif_rawdata; @@ -221,7 +221,7 @@ TIFFWriteEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc) return ((tsize_t) -1); tif->tif_flags |= TIFF_CODERSETUP; } - + tif->tif_rawcc = 0; tif->tif_rawcp = tif->tif_rawdata; @@ -233,7 +233,7 @@ TIFFWriteEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc) /* this forces TIFFAppendToStrip() to do a seek */ tif->tif_curoff = 0; } - + tif->tif_flags &= ~TIFF_POSTENCODE; sample = (tsample_t)(strip / td->td_stripsperimage); if (!(*tif->tif_preencode)(tif, sample)) @@ -369,8 +369,8 @@ TIFFWriteEncodedTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc) /* this forces TIFFAppendToStrip() to do a seek */ tif->tif_curoff = 0; } - - /* + + /* * Compute tiles per row & per column to compute * current row and column */ @@ -497,7 +497,7 @@ TIFFWriteCheck(TIFF* tif, int tiles, const char* module) "Can not write scanlines to a tiled image"); return (0); } - + /* * On the first write verify all the required information * has been setup and initialize any data structures that @@ -515,7 +515,7 @@ TIFFWriteCheck(TIFF* tif, int tiles, const char* module) return (0); } if (tif->tif_dir.td_samplesperpixel == 1) { - /* + /* * Planarconfiguration is irrelevant in case of single band * images and need not be included. We will set it anyway, * because this field is used in other parts of library even @@ -652,7 +652,7 @@ TIFFAppendToStrip(TIFF* tif, tstrip_t strip, tidata_t data, tsize_t cc) } else { tstrip_t i; for (i = 0; i < td->td_nstrips; i++) { - if (td->td_stripoffset[i] > + if (td->td_stripoffset[i] > td->td_stripoffset[strip] && td->td_stripoffset[i] < td->td_stripoffset[strip] + cc) { diff --git a/uppsrc/plugin/tif/lib/tif_zip.c b/uppsrc/plugin/tif/lib/tif_zip.c index 5e3bf2ecb..bce82f41a 100644 --- a/uppsrc/plugin/tif/lib/tif_zip.c +++ b/uppsrc/plugin/tif/lib/tif_zip.c @@ -4,23 +4,23 @@ * Copyright (c) 1995-1997 Sam Leffler * Copyright (c) 1995-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ diff --git a/uppsrc/plugin/tif/lib/tiff.h b/uppsrc/plugin/tif/lib/tiff.h index f9bb7e78e..bd5143aba 100644 --- a/uppsrc/plugin/tif/lib/tiff.h +++ b/uppsrc/plugin/tif/lib/tiff.h @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -41,7 +41,7 @@ * Suite 200 * Seattle, WA 98104 * 206-622-5500 - * + * * (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf) * * For Big TIFF design notes see the following link @@ -368,7 +368,7 @@ typedef enum { /* tags 33300-33309 are private tags registered to Pixar */ /* * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH - * are set when an image has been cropped out of a larger image. + * are set when an image has been cropped out of a larger image. * They reflect the size of the original uncropped image. * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used * to determine the position of the smaller image in the larger one. @@ -411,7 +411,7 @@ typedef enum { /* tags 34232-34236 are private tags registered to Texas Instruments */ #define TIFFTAG_FRAMECOUNT 34232 /* Sequence Frame Count */ /* tag 34377 is private tag registered to Adobe for PhotoShop */ -#define TIFFTAG_PHOTOSHOP 34377 +#define TIFFTAG_PHOTOSHOP 34377 /* tags 34665, 34853 and 40965 are documented in EXIF specification */ #define TIFFTAG_EXIFIFD 34665 /* Pointer to EXIF private directory */ /* tag 34750 is a private tag registered to Adobe? */ @@ -451,7 +451,7 @@ typedef enum { #define TIFFTAG_DEFAULTSCALE 50718 /* &default scale factors */ #define TIFFTAG_DEFAULTCROPORIGIN 50719 /* &origin of the final image area */ -#define TIFFTAG_DEFAULTCROPSIZE 50720 /* &size of the final image +#define TIFFTAG_DEFAULTCROPSIZE 50720 /* &size of the final image area */ #define TIFFTAG_COLORMATRIX1 50721 /* &XYZ->reference color space transformation matrix 1 */ diff --git a/uppsrc/plugin/tif/lib/tiffio.h b/uppsrc/plugin/tif/lib/tiffio.h index 4cd6965b3..7aaf56138 100644 --- a/uppsrc/plugin/tif/lib/tiffio.h +++ b/uppsrc/plugin/tif/lib/tiffio.h @@ -4,18 +4,18 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, @@ -114,7 +114,7 @@ typedef void* thandle_t; /* client data handle */ #define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */ #define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */ -/* +/* * Colour conversion stuff */ @@ -174,7 +174,7 @@ typedef struct _TIFFRGBAImage TIFFRGBAImage; /* * The image reading and conversion routines invoke * ``put routines'' to copy/image/whatever tiles of - * raw image data. A default set of routines are + * raw image data. A default set of routines are * provided to convert/copy raw image data to 8-bit * packed ABGR format rasters. Applications can supply * alternate routines that unpack the data into a @@ -264,7 +264,7 @@ typedef int (*TIFFCloseProc)(thandle_t); typedef toff_t (*TIFFSizeProc)(thandle_t); typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*); typedef void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t); -typedef void (*TIFFExtendProc)(TIFF*); +typedef void (*TIFFExtendProc)(TIFF*); extern const char* TIFFGetVersion(void); @@ -290,13 +290,13 @@ extern void _TIFFfree(tdata_t); */ extern int TIFFGetTagListCount( TIFF * ); extern ttag_t TIFFGetTagListEntry( TIFF *, int tag_index ); - + #define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */ #define TIFF_VARIABLE -1 /* marker for variable length tags */ #define TIFF_SPP -2 /* marker for SamplesPerPixel tags */ #define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */ -#define FIELD_CUSTOM 65 +#define FIELD_CUSTOM 65 typedef struct { ttag_t field_tag; /* field's tag */ @@ -325,13 +325,13 @@ extern const TIFFFieldInfo* TIFFFieldWithName(TIFF*, const char *); typedef int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list); typedef int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list); typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long); - + typedef struct { TIFFVSetMethod vsetfield; /* tag set routine */ TIFFVGetMethod vgetfield; /* tag get routine */ TIFFPrintMethod printdir; /* directory print routine */ } TIFFTagMethods; - + extern TIFFTagMethods *TIFFAccessTagMethods( TIFF * ); extern void *TIFFGetClientInfo( TIFF *, const char * ); extern void TIFFSetClientInfo( TIFF *, void *, const char * ); @@ -495,7 +495,7 @@ extern uint32 LogLuv24fromXYZ(float*, int); extern uint32 LogLuv32fromXYZ(float*, int); #endif #endif /* LOGLUV_PUBLIC */ - + extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, TIFFDisplay *, float*); extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32, float *, float *, float *); diff --git a/uppsrc/plugin/tif/lib/tiffiop.h b/uppsrc/plugin/tif/lib/tiffiop.h index cbd66356b..e32cb1c70 100644 --- a/uppsrc/plugin/tif/lib/tiffiop.h +++ b/uppsrc/plugin/tif/lib/tiffiop.h @@ -4,23 +4,23 @@ * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * - * Permission to use, copy, modify, distribute, and sell this software and + * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ @@ -47,7 +47,7 @@ #ifdef HAVE_ASSERT_H # include #else -# define assert(x) +# define assert(x) #endif #ifdef HAVE_SEARCH_H @@ -110,7 +110,7 @@ struct tiff { #define TIFF_MAPPED 0x0800 /* file is mapped into memory */ #define TIFF_POSTENCODE 0x1000 /* need call to postencode routine */ #define TIFF_INSUBIFD 0x2000 /* currently writing a subifd */ -#define TIFF_UPSAMPLED 0x4000 /* library is doing data up-sampling */ +#define TIFF_UPSAMPLED 0x4000 /* library is doing data up-sampling */ #define TIFF_STRIPCHOP 0x8000 /* enable strip chopping support */ #define TIFF_HEADERONLY 0x10000 /* read header only, do not process */ /* the first directory */ @@ -242,7 +242,7 @@ extern int _TIFFNoRowDecode(TIFF*, tidata_t, tsize_t, tsample_t); extern int _TIFFNoStripDecode(TIFF*, tidata_t, tsize_t, tsample_t); extern int _TIFFNoTileDecode(TIFF*, tidata_t, tsize_t, tsample_t); extern void _TIFFNoPostDecode(TIFF*, tidata_t, tsize_t); -extern int _TIFFNoPreCode (TIFF*, tsample_t); +extern int _TIFFNoPreCode (TIFF*, tsample_t); extern int _TIFFNoSeek(TIFF*, uint32); extern void _TIFFSwab16BitData(TIFF*, tidata_t, tsize_t); extern void _TIFFSwab24BitData(TIFF*, tidata_t, tsize_t); diff --git a/uppsrc/plugin/zip/zip.h b/uppsrc/plugin/zip/zip.h index 4323d810c..1fc8e7e47 100644 --- a/uppsrc/plugin/zip/zip.h +++ b/uppsrc/plugin/zip/zip.h @@ -7,7 +7,7 @@ NAMESPACE_UPP class UnZip { Stream *zip; - + bool error; bool eof; String path; @@ -19,14 +19,14 @@ class UnZip { dword usize; dword done; - void Init(); + void Init(); void ReadHeader(); void SetError() { error = true; } public: bool IsEof() const; operator bool() const { return !IsEof(); } - + bool IsError() const { return error; } bool IsFolder() const; @@ -37,7 +37,7 @@ public: void SkipFile(); bool ReadFile(Stream& out, Gate2 progress = false); String ReadFile(Gate2 progress = false); - + dword GetPos() { return done; } void Create(Stream& in); @@ -51,7 +51,7 @@ class FileUnZip : public UnZip { public: bool Create(const char *name); - + FileUnZip(const char *name) { Create(name); } }; @@ -97,11 +97,11 @@ public: void Create(Stream& out); void Finish(); - + bool IsError() { return zip && zip->IsError(); } dword GetLength() const { return done; } - + Zip(); Zip(Stream& out); ~Zip(); @@ -113,7 +113,7 @@ class FileZip : public Zip { public: bool Create(const char *name); bool Finish(); - + FileZip(const char *name) { Create(name); } ~FileZip() { Finish(); } }; diff --git a/uppsrc/plugin/zip/zip.upp b/uppsrc/plugin/zip/zip.upp index 7bbc4adac..3094b84ce 100644 --- a/uppsrc/plugin/zip/zip.upp +++ b/uppsrc/plugin/zip/zip.upp @@ -2,3 +2,4 @@ file zip.h, Zip.cpp, UnZip.cpp; +