]> err.no Git - sope/commitdiff
fixed gcc 4.0 warnings
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sun, 24 Apr 2005 17:28:21 +0000 (17:28 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sun, 24 Apr 2005 17:28:21 +0000 (17:28 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@769 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

12 files changed:
sope-appserver/WEExtensions/ChangeLog
sope-appserver/WEExtensions/Version
sope-appserver/WEExtensions/WEContextConditional.m
sope-appserver/WEExtensions/WEDragContainer.m
sope-appserver/WEExtensions/WEDropContainer.m
sope-appserver/WEExtensions/WEMonthOverview.m
sope-appserver/WEExtensions/WEPageLink.m
sope-appserver/WEExtensions/WEPageView.m
sope-appserver/WEExtensions/WEQualifierConditional.m
sope-appserver/WEExtensions/WETableCalcMatrix.m
sope-appserver/WEExtensions/WETableView/WETableView+Grouping.m
sope-appserver/WEExtensions/WETreeMatrixElement.m

index 318e67e04fe3a62809698eb6d6d680ea4d33e6c0..b606b702ae052188df866f2ace2bac9dc476841e 100644 (file)
@@ -1,3 +1,7 @@
+2005-04-24  Helge Hess  <helge.hess@opengroupware.org>
+
+       * fixed gcc 4.0 warnings (v4.5.72)
+
 2005-04-12  Helge Hess  <helge.hess@opengroupware.org>
 
        * v4.5.71
index 87270879eea8ea01e052994e33823dd279badc13..8bd79bbbd44fdaaf34e7197152feb37f1962cc91 100644 (file)
@@ -1,5 +1,5 @@
 # version file
 
-SUBMINOR_VERSION:=71
+SUBMINOR_VERSION:=72
 
 # v4.5.65 requires libNGObjWeb v4.5.106
index 64ae33273012d302878f15a56aabd49620d60784..d402c91a965bfbbfbee533120660b47e17bec4c7 100644 (file)
   return self;
 }
 
-#if !LIB_FOUNDATION_BOEHM_GC
 - (void)dealloc {
-  RELEASE(self->template);
-  RELEASE(self->negate);
-  RELEASE(self->contextKey);
-  RELEASE(self->didMatch);
+  [self->template   release];
+  [self->negate     release];
+  [self->contextKey release];
+  [self->didMatch   release];
   [super dealloc];
 }
-#endif
 
-// accessors
+/* accessors */
 
-- (WOElement *)template {
+- (id)template {
   return self->template;
 }
 
@@ -62,7 +60,7 @@
   return nil;
 }
 
-// state
+/* state */
 
 static inline BOOL _doShow(WEContextConditional *self, WOContext *_ctx) {
   BOOL doShow   = NO;
@@ -86,39 +84,36 @@ static inline BOOL _doShow(WEContextConditional *self, WOContext *_ctx) {
   return doShow;
 }
 
-// ******************** responder ********************
+/* handling requests */
 
-- (void)takeValuesFromRequest:(WORequest *)_request
-  inContext:(WOContext *)_ctx
-{
+- (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
   if (_doShow(self, _ctx)) {
     [_ctx appendElementIDComponent:@"1"];
-    [self->template takeValuesFromRequest:_request inContext:_ctx];
+    [self->template takeValuesFromRequest:_rq inContext:_ctx];
     [_ctx deleteLastElementIDComponent];
   }
 }
 
-- (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx {
+- (id)invokeActionForRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
   NSString *state;
+  id result;
 
-  state = [[_ctx currentElementID] stringValue];
+  if ((state = [[_ctx currentElementID] stringValue]) == nil)
+    return nil;
   
-  if (state) {
-    [_ctx consumeElementID]; // consume state-id (on or off)
+  [_ctx consumeElementID]; // consume state-id (on or off)
 
-    if ([state isEqualToString:@"1"]) {
-      id result;
+  if (![state isEqualToString:@"1"])
+    return nil;
       
-      [_ctx appendElementIDComponent:state];
-      result = [self->template invokeActionForRequest:_request inContext:_ctx];
-      [_ctx deleteLastElementIDComponent];
-
-      return result;
-    }
-  }
-  return nil;
+  [_ctx appendElementIDComponent:state];
+  result = [self->template invokeActionForRequest:_rq inContext:_ctx];
+  [_ctx deleteLastElementIDComponent];
+  return result;
 }
 
+/* generate response */
+
 - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
   if (_doShow(self, _ctx)) {
     [_ctx appendElementIDComponent:@"1"];
index d102f529eaad2ee4dfddc2ec748a48024ab3359f..3248d2a73a9fcdf91d1745ccb0ad7d56f3f17e6e 100644 (file)
@@ -195,12 +195,13 @@ static BOOL debugTakeValues = NO;
 
 /* accessors */
 
-- (WOElement *)template {
+- (id)template {
   return self->template;
 }
 
 @end /* WEDragContainer */
 
+
 @implementation WEDragScript
 
 + (void)appendDragScriptToResponse:(WOResponse *)_response
index 665237fc361f503e9261e19b402ecf273eaf2ae2..f480b568029599bee9d7d312a9b23f8692d36f99 100644 (file)
   }
 }
 
-// --- accessors ---
+/* accessors */
 
-- (WOElement *)template {
+- (id)template {
   return self->template;
 }
 
 @end /* WEDropContainer */
 
+
 @implementation WEDropScript
 
 + (void)appendDropScriptToResponse:(WOResponse *)_response
index 60eb9e034becc6afbad4ec6d1cee3dba13e79d63..6ddf7d9fae6fc3b8e7dbb23bd6ffdfa04c77aaf2 100644 (file)
@@ -146,7 +146,7 @@ static NSString *WEMonthOverview_ContentMode = @"WEMonthOverview_ContentMode";
 - (NSDictionary *)monthOverviewContext {
   return [self objectForKey:@"WEMonthOverview"];
 }
-- (NSArray *)monthOverviewQueryObjects {
+- (NSMutableArray *)monthOverviewQueryObjects {
   return [[self monthOverviewContext] valueForKey:@"query"];
 }
 
@@ -189,7 +189,7 @@ static NSString *retStrForInt(int i) {
   case 10: return @"10";
     // TODO: find useful count!
   default: {
-    unsigned char buf[32];
+    char buf[32];
     sprintf(buf, "%i", i);
     return [[StrClass alloc] initWithCString:buf];
   }
@@ -846,31 +846,31 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request,
 }
 
 
-- (void)takeContentValues:(WORequest *)_req
-                inContext:(WOContext *)_ctx
-                    index:(int)_idx
+- (void)takeContentValues:(WORequest *)_req inContext:(WOContext *)_ctx
+  index:(int)_idx
 {
   WOComponent *comp;
   NSString    *s;
   NSArray     *array;
-  int         i, idx, cnt, count;
+  int         i, cnt, count;
 
   comp  = [_ctx component];
   array = [self->list valueInComponent:comp];
   count = [array count];
   
   [_ctx appendElementIDComponent:@"c"]; // append content mode
-
-  cnt = [self->matrix[_idx] count];
-  for (i=0; i<cnt; i++) {
+  
+  for (i = 0, cnt = [self->matrix[_idx] count]; i < cnt; i++) {
+    int idx;
+    
     idx = [[self->matrix[_idx] objectAtIndex:i] intValue];
 
-    if (self->index)
+    if (self->index != nil)
       [self->index setUnsignedIntValue:idx inComponent:comp];
-    if (self->item)
+    if (self->item != nil)
       [self->item setValue:[array objectAtIndex:idx] inComponent:comp];
     
-    s = (self->identifier)
+    s = (self->identifier != nil)
       ? [[self->identifier stringValueInComponent:comp] retain]
       : retStrForInt(idx);
     
@@ -888,7 +888,7 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request,
   NSString       *week;
   int            i, j;
   unsigned int   weekOfYear;
-  unsigned char  buf[32];
+  char           buf[32];
   
   [self _calcMatrixInContext:_ctx];
   
@@ -1018,6 +1018,7 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request,
 
 @end /* WEMonthOverview */
 
+
 @implementation WEMonthLabel
 
 - (id)initWithName:(NSString *)_name
@@ -1045,6 +1046,8 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request,
   [super dealloc];
 }
 
+/* handle requests */
+
 - (void)takeValuesFromRequest:(WORequest *)_req inContext:(WOContext *)_ctx {
   NSDictionary *monthViewContextDict;
   NSString     *orient;
@@ -1055,16 +1058,16 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request,
   isEdge = ([orient rangeOfString:@"/"].length > 0);
   
   monthViewContextDict  = [_ctx monthOverviewContext];
-  if ((tmp = [monthViewContextDict objectForKey:orient]) != nil) {
-    if (!isEdge) {
-      [_ctx appendElementIDComponent:orient];
-      [self->template takeValuesFromRequest:_req inContext:_ctx];
-      [_ctx deleteLastElementIDComponent];
-    }
-    else {
-      [self->template takeValuesFromRequest:_req inContext:_ctx];
-    }
+  if ((tmp = [monthViewContextDict objectForKey:orient]) == nil)
+    return;
+
+  if (!isEdge) {
+    [_ctx appendElementIDComponent:orient];
+    [self->template takeValuesFromRequest:_req inContext:_ctx];
+    [_ctx deleteLastElementIDComponent];
   }
+  else
+    [self->template takeValuesFromRequest:_req inContext:_ctx];
 }
 
 - (id)invokeActionForRequest:(WORequest *)_req inContext:(WOContext *)_ctx {
@@ -1109,6 +1112,8 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request,
   return result;
 }
 
+/* generate response */
+
 - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
   NSDictionary   *monthViewContextDict;
   NSMutableArray *queryContext;
@@ -1182,6 +1187,7 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request,
 
 @end /* WEMonthLabel */
 
+
 @implementation WEMonthTitle
 
 - (id)initWithName:(NSString *)_name
@@ -1247,6 +1253,7 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request,
 
 @end /* WEMonthTitle */
 
+
 @interface WEMonthOverviewInfoMode : WEContextConditional
 @end
 
@@ -1258,6 +1265,7 @@ _takeValuesInCell(WEMonthOverview *self, WORequest *request,
 
 @end /* WEMonthOverviewInfoMode */
 
+
 @interface WEMonthOverviewContentMode : WEContextConditional
 @end
 
index f059623fc6598c3bc629a7ba5e985f661745de59..184f85810a0c43e269ccc479721546d1a84b919e 100644 (file)
   NSString *href;
   
   href = [_ctx componentActionURL];
-  [_response appendContentCString:"<a href=\""];
+  [_response appendContentCString:(unsigned char *)"<a href=\""];
   [_response appendContentString:href];
   [_response appendContentCharacter:'"'];
   
   [_response appendContentCharacter:'>'];
   
   [self->template appendToResponse:_response inContext:_ctx];
-  [_response appendContentCString:"</a>"];
+  [_response appendContentCString:(unsigned char *)"</a>"];
 }
 
 @end /* WEPageLink */
index b72366f8e0b4cc393236f8b82bc86023eca5b933..65feefcefbdb77794585fb484dfa4529038d8e22 100644 (file)
@@ -532,6 +532,7 @@ static inline NSString *WEPageLabelForKey(NSString *_key, WOContext *_ctx) {
     
     cmp = [_ctx component];
   
+    // TODO: use CSS
     tC  = [self->fontColor stringValueInComponent:cmp];
     tF  = [self->fontFace  stringValueInComponent:cmp];
     tS  = [self->fontSize  stringValueInComponent:cmp];
@@ -544,8 +545,9 @@ static inline NSString *WEPageLabelForKey(NSString *_key, WOContext *_ctx) {
     for (i = 0, count = [keys count]; i < count; i++) {
       WEPageItemInfo *info;
 
-      info     = [keys objectAtIndex:i];
+      info = [keys objectAtIndex:i];
 
+      // TODO: use CSS
       if ([info->key isEqualToString:activeKey]) {
         [_response appendContentString:@"<b>"];
         [_response appendContentString:info->title];
@@ -553,7 +555,8 @@ static inline NSString *WEPageLabelForKey(NSString *_key, WOContext *_ctx) {
         break;
       }
     }
-    sprintf(buf, " <small>(%d/%d)</small>", (i + 1), count);
+    // TODO: use CSS
+    sprintf((char *)buf, " <small>(%d/%d)</small>", (i + 1), count);
     [_response appendContentCString:buf];
     
     if (hasFont)
@@ -755,7 +758,7 @@ static inline NSString *WEPageLabelForKey(NSString *_key, WOContext *_ctx) {
   
   if ((k = [self->key stringValueInComponent:[_ctx component]]) == nil) {
     /* auto-assign a key */
-    unsigned char kb[16];
+    char kb[16];
     sprintf(kb, "%d", [keys count]);
     k = [NSString stringWithCString:kb];
   }
index 1b2633bdbddbf0fa33959001cce09dab63036993..ab28c067037d7484fbe0fa69ddaa1a68f5479a81 100644 (file)
 
 /* accessors */
 
-- (WOElement *)template {
+- (id)template {
   return self->template;
 }
 
index 85ac9452a5b1270edc5d5ec46dcfb683808fe3ef..748ce1c13900e89fda4d371d9a7a2e75f4d7027f 100644 (file)
@@ -700,12 +700,13 @@ static inline MatrixEntry *entryAt(WETableCalcMatrix *self, unsigned x,
   id            object;
   
   stripe = [[WETableCalcMatrixStripe alloc]
-                                      initWithSize:self->height
-                                      matrix:self
-                                      delegate:self->delegate];
+                                     initWithSize:self->height
+                                     matrix:self
+                                     delegate:self->delegate];
+  stripe = [stripe autorelease];
   
   objects = [[self objectsInColumn:_x] objectEnumerator];
-  while ((object = [objects nextObject])) {
+  while ((object = [objects nextObject]) != nil) {
     WETableCalcMatrixPositionArray *pos;
     unsigned *indices;
     unsigned idxCount;
@@ -719,18 +720,18 @@ static inline MatrixEntry *entryAt(WETableCalcMatrix *self, unsigned x,
     [stripe addObject:object atPositions:indices count:idxCount];
   }
   
-  AUTORELEASE(stripe);
   return [stripe threadSpans];
 }
-- (id)spansOfRow:(unsigned)_y {
+- (NSArray *)spansOfRow:(unsigned)_y {
   WETableCalcMatrixStripe *stripe;
   NSEnumerator  *objects;
   id            object;
   
   stripe = [[WETableCalcMatrixStripe alloc]
-                                      initWithSize:self->width
-                                      matrix:self
-                                      delegate:self->delegate];
+                                     initWithSize:self->width
+                                     matrix:self
+                                     delegate:self->delegate];
+  stripe = [stripe autorelease];
   
   objects = [[self objectsInRow:_y] objectEnumerator];
   while ((object = [objects nextObject])) {
@@ -747,7 +748,6 @@ static inline MatrixEntry *entryAt(WETableCalcMatrix *self, unsigned x,
     [stripe addObject:object atPositions:indices count:idxCount];
   }
   
-  AUTORELEASE(stripe);
   return [stripe threadSpans];
 }
 
index 51b9c4aa615dc150d5fc390a8a5d9e01eb7cc4d0..7f53d9aae99a0d85299f9c09d0fec8405ea802f0 100644 (file)
@@ -68,7 +68,7 @@
   isCollapsed = ![self->showGroup boolValueInComponent:comp];
   
   [_response appendContentString:@"<tr><td colspan=\""];
-  sprintf(buf, "%d", colspan);
+  sprintf((char *)buf, "%d", colspan);
   [_response appendContentCString:buf];
   [_response appendContentCharacter:'"'];
   
index 601d8bff403055d9a72fdb700dd52e15a4d5daaf..d4170c0a76071dff8fa35b0998a1ccc2c4817e0c 100644 (file)
@@ -103,7 +103,7 @@ static Class StrClass = Nil;
 }
 
 - (NSString *)colspanAsString {
-  unsigned char buf[8];
+  char buf[8];
   sprintf(buf, "%d", self->colspan);
   return [NSString stringWithCString:buf];
 }