From afa5a46239edee080f14fa5295f2c681828cb03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 25 Sep 2006 21:53:56 +0000 Subject: [PATCH] replaced use of vector with BList enables to build correctly with gcc4 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18936 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/hey.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/bin/hey.cpp b/src/bin/hey.cpp index 036fb4405c..7182dec6bd 100644 --- a/src/bin/hey.cpp +++ b/src/bin/hey.cpp @@ -104,13 +104,10 @@ #include #include #include -#include #include #include #include -using std::vector; - int32 HeyInterpreterThreadHook(void* arg); status_t Hey(BMessenger* target, const char* arg, BMessage* reply); @@ -347,7 +344,7 @@ HeyInterpreterThreadHook(void* arg) status_t Hey(BMessenger* target, const char* arg, BMessage* reply) { - vector argv; // number of tokens is now limited only by memory -- pfolk@uni.uiuc.edu 1999-11-03 + BList argv; // number of tokens is now limited only by memory -- pfolk@uni.uiuc.edu 1999-11-03 char* tokens = new char[strlen(arg)*2]; char* currentToken = tokens; int32 tokenNdex = 0; @@ -360,7 +357,7 @@ Hey(BMessenger* target, const char* arg, BMessage* reply) if (!inquotes && isSpace(arg[argNdex])) { // if the character is white space if (tokenNdex!=0) { // close off currentToken token currentToken[tokenNdex] = 0; - argv.push_back(currentToken); + argv.AddItem(currentToken); currentToken += tokenNdex+1; tokenNdex=0; argNdex++; @@ -376,12 +373,12 @@ Hey(BMessenger* target, const char* arg, BMessage* reply) if (tokenNdex!=0) { // close off currentToken token currentToken[tokenNdex] = 0; - argv.push_back(currentToken); + argv.AddItem(currentToken); } - argv.push_back(NULL); + argv.AddItem(NULL); int32 argx = 0; - status_t ret = Hey(target, argv.begin(), &argx, argv.size()-1, reply); + status_t ret = Hey(target, (char **)argv.Items(), &argx, argv.CountItems()-1, reply); // This used to be "return Hey(...);"---so tokens wasn't delete'd. -- pfolk@uni.uiuc.edu 1999-11-03 delete tokens; return ret;