On Fri, 20 Apr 2001, Bill Stoddard wrote:
>-1 (a veto) on this patch.
>
>The Windows compiler doesn't like casts on the left side of the 
>assignment.  yea, it sucks but we've already had this discussion.

The Windows compiler handles casts on the left side of the assignment 
just fine, even at warning level 4 (the maximum warning level) in a 
C++ file.  What it doesn't handle is adding an integer to a void 
*.  The struct_ptr in the assignment has to be changed to an real 
pointer before the addition instead of after the addition.

>+AP_DECLARE_NONSTD(const char *) ap_set_int_slot(cmd_parms *cmd,
>+                                                void *struct_ptr,
>+                                                const char *arg)
>+{
>+    char *endptr;
>+    char *error_str = NULL;
>+    int offset = (int) (long) cmd->info;
>+
>+    *(int *) (struct_ptr + offset) = strtol(arg, &endptr, 10);

If offset is in bytes:
*(int *) ((char *)struct_ptr + offset) = strtol(arg, &endptr, 10);

If offset is in ints
*((int *)struct_ptr + offset) = strtol(arg, &endptr, 10);

-- 
Greg Marr
[EMAIL PROTECTED]
"We thought you were dead."
"I was, but I'm better now." - Sheridan, "The Summoning"

Reply via email to