public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: scox@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Allow for struct/class accessibility defaults. Date: Wed, 20 Feb 2008 02:22:00 -0000 [thread overview] Message-ID: <20080220022200.21060.qmail@sourceware.org> (raw) The branch, master has been updated via 312f766777c680ddc21a09ef364283882e1cfdac (commit) from 2f1786f6895999c01fd41be95f3e902a1d760acc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 312f766777c680ddc21a09ef364283882e1cfdac Author: Stan Cox <scox@redhat.com> Date: Tue Feb 19 21:10:57 2008 -0500 Allow for struct/class accessibility defaults. * funit-type-class.cxx (class_accessibility): New. * CompositeType.java (toPrint): Allow for struct/class access defaults. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/pkglibdir/ChangeLog | 4 ++ frysk-core/frysk/pkglibdir/funit-type-class.cxx | 56 ++++++++++++++++------- frysk-core/frysk/value/ChangeLog | 4 ++ frysk-core/frysk/value/CompositeType.java | 23 ++++++--- 4 files changed, 63 insertions(+), 24 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/pkglibdir/ChangeLog b/frysk-core/frysk/pkglibdir/ChangeLog index ec56b56..0960eaa 100644 --- a/frysk-core/frysk/pkglibdir/ChangeLog +++ b/frysk-core/frysk/pkglibdir/ChangeLog @@ -1,3 +1,7 @@ +2008-02-19 Stan Cox <scox@redhat.com> + + * funit-type-class.cxx (class_accessibility): New. + 2008-02-08 Stan Cox <scox@redhat.com> * funit-quicksort.c (main): Add bubblesort for cross frame/file testing. diff --git a/frysk-core/frysk/pkglibdir/funit-type-class.cxx b/frysk-core/frysk/pkglibdir/funit-type-class.cxx index df008de..25b1154 100644 --- a/frysk-core/frysk/pkglibdir/funit-type-class.cxx +++ b/frysk-core/frysk/pkglibdir/funit-type-class.cxx @@ -1,6 +1,6 @@ // This file is part of the program FRYSK. // -// Copyright 2007, Red Hat Inc. +// Copyright 2007, 2008, Red Hat Inc. // // FRYSK is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by @@ -45,6 +45,32 @@ static void crash (){ a[0] = 0; } +class class_accessibility { + private: + long int long_var; + int int_var; + public: + short int short_var; + protected: + float float_var; + public: + void set_int_var (int int_var); +} class_accessibility; + +// Test: Class +// Name: class_accessibility +// Type: class class_accessibility { +// Type: private: +// Type: long int long_var; +// Type: int int_var; +// Type: public: +// Type: short int short_var; +// Type: protected: +// Type: float float_var; +// Type: public: +// Type: void set_int_var (int); +// Type: } + class Base1 { public: @@ -108,10 +134,8 @@ private: } }; -// Test: Class -// Name: mb +// Name: class_inherited // Type: class Type { -// Type: public: // Type: struct Base1 { // Type: const char *msg; // Type: void Base1 (const char *); @@ -124,15 +148,15 @@ private: // Type: } ; // Type: private: // Type: const char *note; +// Type: public: // Type: void Type (const char *,const char *,const char *); // Type: void ~Type (); // Type: } -Type mb("static", "main", "mb"); +Type class_inherited("static", "main", "mb"); -// Name: new_base +// Name: class_inherited_new // Type: class Type { -// Type: public: // Type: struct Base1 { // Type: const char *msg; // Type: void Base1 (const char *); @@ -145,15 +169,15 @@ Type mb("static", "main", "mb"); // Type: } ; // Type: private: // Type: const char *note; +// Type: public: // Type: void Type (const char *,const char *,const char *); // Type: void ~Type (); // Type: } -Type new_base = Type ("new base", "main", "new_base"); +Type class_inherited_new = Type ("new base", "main", "new_base"); -// Name: xyz +// Name: class_template // Type: class Derived { -// Type: public: // Type: struct Base3 { // Type: int (**_vptr.Base3) (); // Type: void Base3 (void * const &); @@ -178,17 +202,17 @@ Type new_base = Type ("new base", "main", "new_base"); // Type: float do_this_impl<float> (float); // Type: } -Derived xyz; +Derived class_template; static void func () __attribute__ ((noinline)); void func () { - xyz.do_this ((char)'1'); - xyz.do_this ((short)2); - xyz.do_this ((int)3); - xyz.do_this ((float) 4.1); - xyz.do_this ((int)1); + class_template.do_this ((char)'1'); + class_template.do_this ((short)2); + class_template.do_this ((int)3); + class_template.do_this ((float) 4.1); + class_template.do_this ((int)1); crash(); } diff --git a/frysk-core/frysk/value/ChangeLog b/frysk-core/frysk/value/ChangeLog index d4f5f86..7159a99 100644 --- a/frysk-core/frysk/value/ChangeLog +++ b/frysk-core/frysk/value/ChangeLog @@ -1,3 +1,7 @@ +2008-02-19 Stan Cox <scox@redhat.com> + + * CompositeType.java (toPrint): Allow for struct/class access defaults. + 2008-02-19 Nurdin Premji <npremji@redhat.com> * TestInterface.java: New. diff --git a/frysk-core/frysk/value/CompositeType.java b/frysk-core/frysk/value/CompositeType.java index f0c7722..fd6f325 100644 --- a/frysk-core/frysk/value/CompositeType.java +++ b/frysk-core/frysk/value/CompositeType.java @@ -353,18 +353,25 @@ public abstract class CompositeType member = null; } // { content ... } - Access previousAccess = null; + Access previousAccess; + Access currentAccess; + Access defaultAccess; + if (this instanceof ClassType) + defaultAccess = Access.PRIVATE; + else + defaultAccess = Access.PUBLIC; + previousAccess = defaultAccess; + stringBuilder.append(" {\n"); StringBuilder memberStringBuilder = new StringBuilder(); while (member != null) { - if (member.access != previousAccess) { - previousAccess = member.access; - if (member.access != null) { - stringBuilder.append(" "); - stringBuilder.append(member.access.toPrint()); - stringBuilder.append(":\n"); - } + currentAccess = (member.access != null) ? member.access : defaultAccess; + if (currentAccess != previousAccess) { + previousAccess = currentAccess; + stringBuilder.append(" "); + stringBuilder.append(currentAccess.toPrint()); + stringBuilder.append(":\n"); } memberStringBuilder.delete(0, memberStringBuilder.length()); memberStringBuilder.append(" " + member.name); hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-02-20 2:22 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080220022200.21060.qmail@sourceware.org \ --to=scox@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).