Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion NCI Nested Struct Access Broken?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chromatic  
View profile  
 More options May 4 2004, 2:02 am
Newsgroups: perl.perl6.internals
From: bugs-par...@netlabs.develooper.com (Chromatic)
Date: Mon, 03 May 2004 23:02:11 -0700
Local: Tues, May 4 2004 2:02 am
Subject: [perl #29333] NCI Nested Struct Access Broken?

# New Ticket Created by  chromatic
# Please include the string:  [perl #29333]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=29333 >

>From Parrot, I'm trying to access a struct within a struct.  Given an

SDL_Surface named surface, the relevant C code is:

        int bpp = surface->format->BytesPerPixel;

Given surface, a working UnManagedStruct representing an SDL_Surface (to
which I can draw -- that part works), I'd expect the following PIR to be
equivalent:

        .local int bpp
        bpp = surface[ 'format'; 'BytesPerPixel' ]

However this complains about the unknown key 'BytesPerPixel'.

The attached test patch demonstrates what I think is a problem.  Running
gdb and looking through unmanagedstruct.pmc makes me wonder if the
PMC_val of the nested struct is ever actually assigned to the enclosing
struct.

Then again, I'm not a great C programmer and it is late here.  I could
be doing things *completely* wrongly, in which case I'll write a
documentation patch to make things more clear after someone explains it
to me.

-- c

  nested_nci_access.patch
2K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.