On Fri, Oct 26, 2012 at 11:14 AM, David Ashley <w.david.ash...@gmail.com>wrote:

> Well something is not right because the semdata variable is NOT a
> uintptr_t data type. It is a pointer to a structure.
>

That is correct.  A uintptr_t value is an integer value that is guaranteed
to be the same size as a pointer.  On return, that value will be turned
into a string object for the Rexx programmer, and when passed back into a
function that specifies uintptr_t as an argument type, that string value
gets transformed back into a binary value that can be cast back into a
pointer.  The only error here is which value is getting returned, not the
return type itself.

Rick


>
> David Ashley
>
> On Fri, 2012-10-26 at 11:06 -0400, Rick McGuire wrote:
> > David,
> >
> >
> > The change to SysOpenEventSem is NOT correct.  The value being
> > returned is not an object pointer.  This will result in a crash the
> > first time the garbage collector runs.  The original return type is
> > correct, the only change should be which pointer value is getting
> > returned.
> >
> >
> > Rick
> >
> > ---------- Forwarded message ----------
> > From: <wdash...@users.sf.net>
> > Date: Fri, Oct 26, 2012 at 10:59 AM
> > Subject: [Oorexx-svn] SF.net SVN: oorexx-code-0:[8537]
> > main/trunk/extensions/rexxutil/platform/ unix/rexxutil.cpp
> > To: oorexx-...@lists.sourceforge.net
> >
> >
> > Revision: 8537
> >           http://sourceforge.net/p/oorexx/code-0/8537
> > Author:   wdashley
> > Date:     2012-10-26 14:59:37 +0000 (Fri, 26 Oct 2012)
> > Log Message:
> > -----------
> > Fix for bug 1137.
> >
> > Modified Paths:
> > --------------
> >     main/trunk/extensions/rexxutil/platform/unix/rexxutil.cpp
> >
> > Modified: main/trunk/extensions/rexxutil/platform/unix/rexxutil.cpp
> > ===================================================================
> > --- main/trunk/extensions/rexxutil/platform/unix/rexxutil.cpp
> > 2012-10-25 14:04:42 UTC (rev 8536)
> > +++ main/trunk/extensions/rexxutil/platform/unix/rexxutil.cpp
> > 2012-10-26 14:59:37 UTC (rev 8537)
> > @@ -1919,7 +1919,6 @@
> >      }
> >      else {
> >          /* this is a named semaphore */
> > -        sem_unlink(name);
> >          semdata->handle = sem_open(name, (O_CREAT | O_EXCL), (S_IRWXU
> > | S_IRWXG), 0);
> >          if (semdata->handle == SEM_FAILED ) {
> >              free(semdata);
> > @@ -1941,7 +1940,7 @@
> >  * Return:    result - return code from DosOpenEventSem
> > *
> >
>  *************************************************************************/
> >
> > -RexxMethod1(uintptr_t, SysOpenEventSem, CSTRING, name)
> > +RexxMethod1(RexxObjectPtr, SysOpenEventSem, CSTRING, name)
> >  {
> >      RXSEMDATA *semdata;
> >
> > @@ -1954,7 +1953,7 @@
> >          return 0;
> >      }
> >      semdata->named = true;
> > -    return (uintptr_t)semdata->handle;
> > +    return (RexxObjectPtr)semdata;
> >  }
> >
> >
> > @@ -2122,7 +2121,6 @@
> >      }
> >      else {
> >          /* this is a named semaphore */
> > -        sem_unlink(name);
> >          semdata->handle = sem_open(name, (O_CREAT | O_EXCL), (S_IRWXU
> > | S_IRWXG), 0);
> >          if (semdata->handle == SEM_FAILED ) {
> >              free(semdata);
> > @@ -2145,7 +2143,7 @@
> >  * Return:    result - return code from DosOpenEventSem
> > *
> >
>  *************************************************************************/
> >
> > -RexxRoutine1(uintptr_t, SysOpenMutexSem, CSTRING, name)
> > +RexxRoutine1(RexxObjectPtr, SysOpenMutexSem, CSTRING, name)
> >  {
> >      RXSEMDATA *semdata;
> >
> > @@ -2158,7 +2156,7 @@
> >          return 0;
> >      }
> >      semdata->named = true;
> > -    return (uintptr_t)semdata->handle;
> > +    return (RexxObjectPtr)semdata;
> >  }
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Everyone hates slow websites. So do we.
> > Make your web apps faster with AppDynamics
> > Download AppDynamics Lite for free today:
> > http://p.sf.net/sfu/appdyn_sfd2d_oct
> > _______________________________________________
> > Oorexx-svn mailing list
> > oorexx-...@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/oorexx-svn
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Everyone hates slow websites. So do we.
> > Make your web apps faster with AppDynamics
> > Download AppDynamics Lite for free today:
> > http://p.sf.net/sfu/appdyn_sfd2d_oct
> > _______________________________________________ Oorexx-devel mailing
> list Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
>
>
>
> ------------------------------------------------------------------------------
> The Windows 8 Center
> In partnership with Sourceforge
> Your idea - your app - 30 days. Get started!
> http://windows8center.sourceforge.net/
> what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
> _______________________________________________
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
------------------------------------------------------------------------------
The Windows 8 Center 
In partnership with Sourceforge
Your idea - your app - 30 days. Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to