hrev46656 adds 9 changesets to branch 'master' old head: a2bf375cbda523490de43c3a389b91a2e36780eb new head: faf564a527469557e9f3929c25991a383473e8a3 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=faf564a+%5Ea2bf375 ---------------------------------------------------------------------------- 6abec6b: Declare BLooperListIterator in the right place. Before, it tried to typedef it to a private struct, but outside of the class. 4bda021: Add BStackOrHeapArray. f4c2f7e: Remove variable length arrays of non-PODs. Variable length arrays of non-PODs are not part of the C++ standard, but a GNU extension that never worked correctly. Instead, BStackOrHeap array is used now, which makes sure that it's not too big for the stack, calls all constructors and is valid C++. 4683fcc: glibc: Correctly create weak symbols. 38fee4c: glibc: Remove nested function. Nested functions are a (again, broken) GNU extension which is not supported by Clang. It has been replaced by a bunch of gotos and a variable that works as a return address. 72b1405: Fix sizeof on private, non static variable. 04a0e9c: ALM: Move forward declaration of Constraint to the right namespace. b187bd9: compress: Add missing return types and declarations. faf564a: netcat: Add missing declaration. [ Jonathan Schleifer <js@xxxxxxxxxxx> ] ---------------------------------------------------------------------------- 19 files changed, 125 insertions(+), 37 deletions(-) headers/libs/alm/ALMLayout.h | 6 ++- headers/os/support/StackOrHeapArray.h | 42 ++++++++++++++++++++ headers/private/app/LooperList.h | 1 + .../media/media-add-ons/mixer/MixerCore.cpp | 6 ++- src/apps/fontdemo/FontDemoView.cpp | 5 ++- src/apps/icon-o-matic/shape/PathManipulator.cpp | 3 +- src/apps/soundrecorder/VUView.cpp | 3 +- src/apps/terminal/BasicTerminalBuffer.cpp | 3 +- src/bin/compress/compress.c | 10 ++++- src/bin/network/netcat/netcat.c | 6 +++ src/kits/app/LooperList.cpp | 2 - src/kits/app/ServerLink.cpp | 5 ++- src/kits/support/ArchivingManagers.cpp | 4 +- src/kits/tracker/ViewState.cpp | 2 +- src/servers/app/ServerApp.cpp | 15 ++++--- src/servers/app/drawing/DrawingEngine.cpp | 5 ++- src/system/libroot/posix/arch/x86/fenv.c | 4 +- .../libroot/posix/glibc/arch/generic/w_dremf.c | 6 +-- .../libroot/posix/glibc/stdio-common/printf_fp.c | 34 ++++++++++++---- ############################################################################ Commit: 6abec6b93a9a7bbc0b0384cbedf93288dffc4965 URL: http://cgit.haiku-os.org/haiku/commit/?id=6abec6b Author: Jonathan Schleifer <js@xxxxxxxxxxx> Date: Fri Jan 10 20:06:29 2014 UTC Committer: Stephan Aßmus <superstippi@xxxxxx> Commit-Date: Fri Jan 10 21:31:37 2014 UTC Declare BLooperListIterator in the right place. Before, it tried to typedef it to a private struct, but outside of the class. ---------------------------------------------------------------------------- diff --git a/headers/private/app/LooperList.h b/headers/private/app/LooperList.h index 7bdc824..4968628 100644 --- a/headers/private/app/LooperList.h +++ b/headers/private/app/LooperList.h @@ -52,6 +52,7 @@ private: BLooper* looper; }; + typedef std::vector<BLooperList::LooperData>::iterator LooperDataIterator; struct FindLooperPred { FindLooperPred(const BLooper* loop) : looper(loop) {} bool operator()(LooperData& Data); diff --git a/src/kits/app/LooperList.cpp b/src/kits/app/LooperList.cpp index e27460a..98902fc 100644 --- a/src/kits/app/LooperList.cpp +++ b/src/kits/app/LooperList.cpp @@ -25,8 +25,6 @@ namespace BPrivate { BLooperList gLooperList; -typedef vector<BLooperList::LooperData>::iterator LooperDataIterator; - BLooperList::BLooperList() : ############################################################################ Commit: 4bda0212cedb6225acb3a1b7cc9f61d395787b1f URL: http://cgit.haiku-os.org/haiku/commit/?id=4bda021 Author: Jonathan Schleifer <js@xxxxxxxxxxx> Date: Fri Jan 10 20:06:32 2014 UTC Committer: Stephan Aßmus <superstippi@xxxxxx> Commit-Date: Fri Jan 10 21:31:46 2014 UTC Add BStackOrHeapArray. ---------------------------------------------------------------------------- diff --git a/headers/os/support/StackOrHeapArray.h b/headers/os/support/StackOrHeapArray.h new file mode 100644 index 0000000..af40bf0 --- /dev/null +++ b/headers/os/support/StackOrHeapArray.h @@ -0,0 +1,42 @@ +/* + * Copyright 2012, Jonathan Schleifer <js@xxxxxxxxxxx>. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _SUPPORT_STACKORHEAPARRAY_H +#define _SUPPORT_STACKORHEAPARRAY_H + +#include <new> + +template <typename Type, int StackSize> +class BStackOrHeapArray { +public: + BStackOrHeapArray(size_t count) + { + if (count > StackSize) + fData = new(std::nothrow) Type[count]; + else + fData = fStackData; + } + + ~BStackOrHeapArray() + { + if (fData != fStackData) + delete[] fData; + } + + bool IsValid() const + { + return fData != NULL; + } + + operator Type*() + { + return fData; + } + +private: + Type fStackData[StackSize]; + Type* fData; +}; + +#endif ############################################################################ Commit: f4c2f7ebdb11576420c00fc4ecb23b32c3ce3137 URL: http://cgit.haiku-os.org/haiku/commit/?id=f4c2f7e Author: Jonathan Schleifer <js@xxxxxxxxxxx> Date: Fri Jan 10 20:06:36 2014 UTC Committer: Stephan Aßmus <superstippi@xxxxxx> Commit-Date: Fri Jan 10 21:31:50 2014 UTC Remove variable length arrays of non-PODs. Variable length arrays of non-PODs are not part of the C++ standard, but a GNU extension that never worked correctly. Instead, BStackOrHeap array is used now, which makes sure that it's not too big for the stack, calls all constructors and is valid C++. ---------------------------------------------------------------------------- diff --git a/src/add-ons/media/media-add-ons/mixer/MixerCore.cpp b/src/add-ons/media/media-add-ons/mixer/MixerCore.cpp index 4931f45..5af27a6 100644 --- a/src/add-ons/media/media-add-ons/mixer/MixerCore.cpp +++ b/src/add-ons/media/media-add-ons/mixer/MixerCore.cpp @@ -16,6 +16,7 @@ #include <BufferProducer.h> #include <MediaNode.h> #include <RealtimeAlloc.h> +#include <StackOrHeapArray.h> #include <StopWatch.h> #include <TimeSource.h> @@ -520,8 +521,9 @@ MixerCore::_MixThread() uint64 bufferIndex = 0; #endif - RtList<chan_info> inputChanInfos[MAX_CHANNEL_TYPES]; - RtList<chan_info> mixChanInfos[fMixBufferChannelCount]; + typedef RtList<chan_info> chan_info_list; + chan_info_list inputChanInfos[MAX_CHANNEL_TYPES]; + BStackOrHeapArray<chan_info_list, 16> mixChanInfos(fMixBufferChannelCount); // TODO: this does not support changing output channel count bigtime_t eventTime = timeBase; diff --git a/src/apps/fontdemo/FontDemoView.cpp b/src/apps/fontdemo/FontDemoView.cpp index af4205e..ec1ab54 100644 --- a/src/apps/fontdemo/FontDemoView.cpp +++ b/src/apps/fontdemo/FontDemoView.cpp @@ -20,6 +20,7 @@ #include <Message.h> #include <Shape.h> #include <String.h> +#include <StackOrHeapArray.h> #include "messages.h" @@ -99,7 +100,7 @@ FontDemoView::_DrawView(BView* view) view->SetFont(&fFont, B_FONT_ALL); const size_t size = fString.CountChars(); - BRect boundBoxes[size]; + BStackOrHeapArray<BRect, 64> boundBoxes(size); if (OutLineLevel()) fFont.GetGlyphShapes(fString, size, fShapes); @@ -456,4 +457,4 @@ FontDemoView::_NewBitmap(BRect rect) delete fBitmap; fBitmap = NULL; } -} \ No newline at end of file +} diff --git a/src/apps/icon-o-matic/shape/PathManipulator.cpp b/src/apps/icon-o-matic/shape/PathManipulator.cpp index fa30575..4e50c11 100644 --- a/src/apps/icon-o-matic/shape/PathManipulator.cpp +++ b/src/apps/icon-o-matic/shape/PathManipulator.cpp @@ -14,6 +14,7 @@ #include <Message.h> #include <MenuItem.h> #include <PopUpMenu.h> +#include <StackOrHeapArray.h> #include <Window.h> #include "cursors.h" @@ -1703,7 +1704,7 @@ PathManipulator::_Nudge(BPoint direction) int32 count = fromSelection ? fSelection->CountItems() : fPath->CountPoints(); int32 indices[count]; - control_point points[count]; + BStackOrHeapArray<control_point, 64> points(count); // init indices and points for (int32 i = 0; i < count; i++) { diff --git a/src/apps/soundrecorder/VUView.cpp b/src/apps/soundrecorder/VUView.cpp index c90afc5..2f6112b 100644 --- a/src/apps/soundrecorder/VUView.cpp +++ b/src/apps/soundrecorder/VUView.cpp @@ -11,6 +11,7 @@ #include <MediaDefs.h> #include <Screen.h> +#include <StackOrHeapArray.h> #include <Window.h> #include "DrawingTidbits.h" @@ -108,7 +109,7 @@ VUView::_RenderLaunch(void *data) void VUView::_RenderLoop() { - rgb_color levels[fLevelCount][2]; + BStackOrHeapArray<rgb_color[2], 64> levels(fLevelCount); for (int32 i = 0; i < fLevelCount; i++) { levels[i][0] = levels[i][1] = back_color; diff --git a/src/apps/terminal/BasicTerminalBuffer.cpp b/src/apps/terminal/BasicTerminalBuffer.cpp index dfbb54e..0006066 100644 --- a/src/apps/terminal/BasicTerminalBuffer.cpp +++ b/src/apps/terminal/BasicTerminalBuffer.cpp @@ -18,6 +18,7 @@ #include <algorithm> +#include <StackOrHeapArray.h> #include <String.h> #include "TermConst.h" @@ -537,7 +538,7 @@ BasicTerminalBuffer::Find(const char* _pattern, const TermPos& start, int32 patternByteLen = strlen(_pattern); // convert pattern to UTF8Char array - UTF8Char pattern[patternByteLen]; + BStackOrHeapArray<UTF8Char, 64> pattern(patternByteLen); int32 patternLen = 0; while (*_pattern != '\0') { int32 charLen = UTF8Char::ByteCount(*_pattern); diff --git a/src/kits/app/ServerLink.cpp b/src/kits/app/ServerLink.cpp index ea7664a..05ac105 100644 --- a/src/kits/app/ServerLink.cpp +++ b/src/kits/app/ServerLink.cpp @@ -25,6 +25,7 @@ #include <GradientConic.h> #include <Region.h> #include <Shape.h> +#include <StackOrHeapArray.h> #include <ServerProtocol.h> @@ -96,11 +97,11 @@ ServerLink::ReadShape(BShape* shape) fReceiver->Read(&opCount, sizeof(int32)); fReceiver->Read(&ptCount, sizeof(int32)); - uint32 opList[opCount]; + BStackOrHeapArray<uint32, 64> opList(opCount); if (opCount > 0) fReceiver->Read(opList, opCount * sizeof(uint32)); - BPoint ptList[ptCount]; + BStackOrHeapArray<BPoint, 64> ptList(ptCount); if (ptCount > 0) fReceiver->Read(ptList, ptCount * sizeof(BPoint)); diff --git a/src/kits/support/ArchivingManagers.cpp b/src/kits/support/ArchivingManagers.cpp index 3405b53..069b339 100644 --- a/src/kits/support/ArchivingManagers.cpp +++ b/src/kits/support/ArchivingManagers.cpp @@ -11,6 +11,8 @@ #include <syslog.h> #include <typeinfo> +#include <StackOrHeapArray.h> + namespace BPrivate { namespace Archiving { @@ -163,7 +165,7 @@ BArchiveManager::ArchiverLeaving(const BArchiver* archiver, status_t err) if (archiver == fCreator && fError == B_OK) { // first, we must sort the objects into the order they were archived in typedef std::pair<BMessage*, const BArchivable*> ArchivePair; - ArchivePair pairs[fTokenMap.size()]; + BStackOrHeapArray<ArchivePair, 64> pairs(fTokenMap.size()); for(TokenMap::iterator it = fTokenMap.begin(), end = fTokenMap.end(); it != end; it++) { diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index 057df07..8c0122a 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -34,6 +34,7 @@ #include <ScrollBar.h> #include <Shape.h> #include <String.h> +#include <StackOrHeapArray.h> #include <FontPrivate.h> #include <MessengerPrivate.h> @@ -1856,10 +1857,9 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) size = 0.0f; } - // TODO: don't use the stack for this - numStrings could be large - float widthArray[numStrings]; - int32 lengthArray[numStrings]; - char *stringArray[numStrings]; + BStackOrHeapArray<float, 64> widthArray(numStrings); + BStackOrHeapArray<int32, 64> lengthArray(numStrings); + BStackOrHeapArray<char*, 64> stringArray(numStrings); for (int32 i = 0; i < numStrings; i++) { // This version of ReadString allocates the strings, we free // them below @@ -1882,7 +1882,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) } fLink.StartMessage(B_OK); - fLink.Attach(widthArray, sizeof(widthArray)); + fLink.Attach(widthArray, numStrings * sizeof(float)); } else fLink.StartMessage(B_BAD_VALUE); @@ -2497,8 +2497,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) link.Read<escapement_delta>(&deltaArray[i]); } - // TODO: don't do this on the heap! (at least check the size before) - BRect rectArray[numStrings]; + BStackOrHeapArray<BRect, 64> rectArray(numStrings); ServerFont font; bool success = false; @@ -2513,7 +2512,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) if (font.GetBoundingBoxesForStrings(stringArray, lengthArray, numStrings, rectArray, mode, deltaArray) == B_OK) { fLink.StartMessage(B_OK); - fLink.Attach(rectArray, sizeof(rectArray)); + fLink.Attach(rectArray, numStrings * sizeof(BRect)); success = true; } } diff --git a/src/servers/app/drawing/DrawingEngine.cpp b/src/servers/app/drawing/DrawingEngine.cpp index 4ec70d7..6ef0b85 100644 --- a/src/servers/app/drawing/DrawingEngine.cpp +++ b/src/servers/app/drawing/DrawingEngine.cpp @@ -10,7 +10,10 @@ #include "DrawingEngine.h" #include <Bitmap.h> +#include <StackOrHeapArray.h> + #include <stdio.h> + #include <algorithm> #include <stack> @@ -469,7 +472,7 @@ DrawingEngine::CopyRegion(/*const*/ BRegion* region, int32 xOffset, // TODO: make this step unnecessary // (by using different stack impl inside node) - node nodes[count]; + BStackOrHeapArray<node, 64> nodes(count); for (int32 i= 0; i < count; i++) { nodes[i].init(region->RectAt(i), count); } ############################################################################ Commit: 4683fcc35c07a3ca188224536eba8af10e73bf8c URL: http://cgit.haiku-os.org/haiku/commit/?id=4683fcc Author: Jonathan Schleifer <js@xxxxxxxxxxx> Date: Fri Jan 10 20:06:39 2014 UTC Committer: Stephan Aßmus <superstippi@xxxxxx> Commit-Date: Fri Jan 10 21:31:58 2014 UTC glibc: Correctly create weak symbols. ---------------------------------------------------------------------------- diff --git a/src/system/libroot/posix/arch/x86/fenv.c b/src/system/libroot/posix/arch/x86/fenv.c index b0c657b..1884bc1 100644 --- a/src/system/libroot/posix/arch/x86/fenv.c +++ b/src/system/libroot/posix/arch/x86/fenv.c @@ -207,5 +207,5 @@ __fedisableexcept(int mask) return (~omask); } -__weak_reference(__feenableexcept, feenableexcept); -__weak_reference(__fedisableexcept, fedisableexcept); +int feenableexcept(int) __attribute__((weak, alias("__feenableexcept"))); +int fedisableexcept(int) __attribute__((weak, alias("__fedisableexcept"))); diff --git a/src/system/libroot/posix/glibc/arch/generic/w_dremf.c b/src/system/libroot/posix/glibc/arch/generic/w_dremf.c index b740ea3..e040d98 100644 --- a/src/system/libroot/posix/glibc/arch/generic/w_dremf.c +++ b/src/system/libroot/posix/glibc/arch/generic/w_dremf.c @@ -9,9 +9,9 @@ #include "math_private.h" float -__dremf(x, y) - float x, y; +__dremf(float x, float y) { return __remainderf(x, y); } -weak_alias (__dremf, dremf) + +float dremf(float, float) __attribute__((weak, alias("__dremf"))); ############################################################################ Commit: 38fee4c388a48be555e5866cba404b0bb6fad20e URL: http://cgit.haiku-os.org/haiku/commit/?id=38fee4c Author: Jonathan Schleifer <js@xxxxxxxxxxx> Date: Fri Jan 10 20:06:42 2014 UTC Committer: Stephan Aßmus <superstippi@xxxxxx> Commit-Date: Fri Jan 10 21:32:05 2014 UTC glibc: Remove nested function. Nested functions are a (again, broken) GNU extension which is not supported by Clang. It has been replaced by a bunch of gotos and a variable that works as a return address. ---------------------------------------------------------------------------- diff --git a/src/system/libroot/posix/glibc/stdio-common/printf_fp.c b/src/system/libroot/posix/glibc/stdio-common/printf_fp.c index 4c68c5e..d22c731 100644 --- a/src/system/libroot/posix/glibc/stdio-common/printf_fp.c +++ b/src/system/libroot/posix/glibc/stdio-common/printf_fp.c @@ -200,12 +200,14 @@ __printf_fp (FILE *fp, /* Nonzero if this is output on a wide character stream. */ int wide = info->wide; - auto wchar_t hack_digit (void); + wchar_t hack_digit_ret; + int hack_digit_callee; - wchar_t hack_digit (void) + while (0) { mp_limb_t hi; +hack_digit: if (expsign != 0 && type == 'f' && exponent-- > 0) hi = 0; else if (scalesize == 0) @@ -232,7 +234,8 @@ __printf_fp (FILE *fp, /* We're not prepared for an mpn variable with zero limbs. */ fracsize = 1; - return L'0' + hi; + hack_digit_ret = L'0' + hi; + goto hack_digit_end; } } @@ -241,7 +244,15 @@ __printf_fp (FILE *fp, frac[fracsize++] = cy; } - return L'0' + hi; + hack_digit_ret = L'0' + hi; +hack_digit_end: + switch (hack_digit_callee) + { + case 1: goto hack_digit_callee1; + case 2: goto hack_digit_callee2; + case 3: goto hack_digit_callee3; + default: abort(); + } } @@ -885,7 +896,10 @@ __printf_fp (FILE *fp, while (intdig_no < intdig_max) { ++intdig_no; - *wcp++ = hack_digit (); + hack_digit_callee = 1; + goto hack_digit; +hack_digit_callee1: + *wcp++ = hack_digit_ret; } significant = 1; if (info->alt @@ -907,7 +921,10 @@ __printf_fp (FILE *fp, || (fracdig_no < fracdig_max && (fracsize > 1 || frac[0] != 0))) { ++fracdig_no; - *wcp = hack_digit (); + hack_digit_callee = 2; + goto hack_digit; +hack_digit_callee2: + *wcp++ = hack_digit_ret; if (*wcp != L'0') significant = 1; else if (significant == 0) @@ -920,7 +937,10 @@ __printf_fp (FILE *fp, } /* Do rounding. */ - digit = hack_digit (); + hack_digit_callee = 3; + goto hack_digit; +hack_digit_callee3: + digit = hack_digit_ret; if (digit > L'4') { wchar_t *wtp = wcp; ############################################################################ Commit: 72b14059a9357eb84d7ab0b4ef60ece98d4c53b1 URL: http://cgit.haiku-os.org/haiku/commit/?id=72b1405 Author: Jonathan Schleifer <js@xxxxxxxxxxx> Date: Fri Jan 10 20:06:46 2014 UTC Committer: Stephan Aßmus <superstippi@xxxxxx> Commit-Date: Fri Jan 10 21:32:10 2014 UTC Fix sizeof on private, non static variable. ---------------------------------------------------------------------------- diff --git a/src/kits/tracker/ViewState.cpp b/src/kits/tracker/ViewState.cpp index 831ccf4..5420c1d 100644 --- a/src/kits/tracker/ViewState.cpp +++ b/src/kits/tracker/ViewState.cpp @@ -119,7 +119,7 @@ BColumn::BColumn(BMallocIO* stream, int32 version, bool endianSwap) PRINT(("endian swapping column\n")); fOffset = B_SWAP_FLOAT(fOffset); fWidth = B_SWAP_FLOAT(fWidth); - STATIC_ASSERT(sizeof(BColumn::fAlignment) == sizeof(int32)); + STATIC_ASSERT(sizeof(alignment) == sizeof(int32)); fAlignment = (alignment)B_SWAP_INT32(fAlignment); fAttrHash = B_SWAP_INT32(fAttrHash); fAttrType = B_SWAP_INT32(fAttrType); ############################################################################ Commit: 04a0e9c7b68cbe3a43d38e2bca8e860fd80936fb URL: http://cgit.haiku-os.org/haiku/commit/?id=04a0e9c Author: Jonathan Schleifer <js@xxxxxxxxxxx> Date: Fri Jan 10 20:06:48 2014 UTC Committer: Stephan Aßmus <superstippi@xxxxxx> Commit-Date: Fri Jan 10 21:32:15 2014 UTC ALM: Move forward declaration of Constraint to the right namespace. ---------------------------------------------------------------------------- diff --git a/headers/libs/alm/ALMLayout.h b/headers/libs/alm/ALMLayout.h index 98522b8..3a691c1 100644 --- a/headers/libs/alm/ALMLayout.h +++ b/headers/libs/alm/ALMLayout.h @@ -16,7 +16,11 @@ class BView; class BLayoutItem; -class Constraint; + + +namespace LinearProgramming { + class Constraint; +}; namespace BPrivate { ############################################################################ Commit: b187bd95a017d3bf40335d8e13d09c72a579ce17 URL: http://cgit.haiku-os.org/haiku/commit/?id=b187bd9 Author: Jonathan Schleifer <js@xxxxxxxxxxx> Date: Fri Jan 10 20:06:51 2014 UTC Committer: Stephan Aßmus <superstippi@xxxxxx> Commit-Date: Fri Jan 10 21:32:21 2014 UTC compress: Add missing return types and declarations. ---------------------------------------------------------------------------- diff --git a/src/bin/compress/compress.c b/src/bin/compress/compress.c index 7c6da280..b68283c 100644 --- a/src/bin/compress/compress.c +++ b/src/bin/compress/compress.c @@ -494,6 +494,10 @@ void (*bgnd_flag)(); int do_decomp = 0; +void compress(void); +void decompress(void); +void copystat(char *ifname, char *ofname); + /***************************************************************** * TAG( main ) * @@ -947,6 +951,7 @@ long int out_count = 0; /* # of codes output (for debugging) */ * questions about this implementation to ames!jaw. */ +void compress() { register long fcode; register code_int i = 0; @@ -1215,6 +1220,7 @@ code_int code; * with those of the compress() routine. See the definitions above. */ +void decompress() { #ifdef BIG @@ -1515,8 +1521,8 @@ writeerr() exit ( 1 ); } -copystat(ifname, ofname) -char *ifname, *ofname; +void +copystat(char *ifname, char *ofname) { struct stat statbuf; int mode; ############################################################################ Revision: hrev46656 Commit: faf564a527469557e9f3929c25991a383473e8a3 URL: http://cgit.haiku-os.org/haiku/commit/?id=faf564a Author: Jonathan Schleifer <js@xxxxxxxxxxx> Date: Fri Jan 10 20:06:54 2014 UTC Committer: Stephan Aßmus <superstippi@xxxxxx> Commit-Date: Fri Jan 10 21:32:29 2014 UTC netcat: Add missing declaration. ---------------------------------------------------------------------------- diff --git a/src/bin/network/netcat/netcat.c b/src/bin/network/netcat/netcat.c index e46fad2..8de7ecc 100644 --- a/src/bin/network/netcat/netcat.c +++ b/src/bin/network/netcat/netcat.c @@ -175,6 +175,11 @@ USHORT o_zero = 0; /* support routines -- the bulk of this thing. Placed in such an order that we don't have to forward-declare anything: */ +#ifdef HAVE_HELP +void helpme(); +#endif + + /* holler : fake varargs -- need to do this way because we wind up calling through more levels of indirection than vanilla varargs can handle, and not all @@ -1312,6 +1317,7 @@ Debug (("wrote %d to net, errno %d", rr, errno)) return (0); } /* readwrite */ + /* main : now we pull it all together... */ main (argc, argv)