~ubuntu-branches/ubuntu/jaunty/aspectc++/jaunty

« back to all changes in this revision

Viewing changes to Puma/src/parser/cparser/CSemDeclarator.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-07-07 14:41:02 UTC
  • mfrom: (1.1.3 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707144102-lzml7t07f3sl00r5
Tags: 1.0pre4~svn.20080711-1
* new upstream snapshot.
* include all upstream documentation. Clarifying emails regarding
  licensing has been included into debian/copyright.
* reformat description following recomendations of
  http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description
  (Closes: #480316)

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
          }
143
143
        }
144
144
      }
145
 
      ad->setTypeRef (_type);
146
145
      node = ad->Declarator ();
147
146
    } else if (node->NodeName () == CT_FctDeclarator::NodeId ()) {
148
147
      CT_FctDeclarator *fd = (CT_FctDeclarator*)node;
212
211
 
213
212
void CSemDeclarator::HandleQualifiers (CT_DeclSpecSeq *dss, bool is_fct) {
214
213
  if (dss) {
215
 
    int c_count = 0;
216
 
    int v_count = 0;
217
 
    int r_count = 0;
 
214
    CTypeQualified* qt = _type->TypeQualified ();
 
215
    int c_count = qt && qt->isConst () ? 1 : 0;
 
216
    int v_count = qt && qt->isVolatile () ? 1 : 0;
 
217
    int r_count = qt && qt->isRestrict () ? 1 : 0;
218
218
    for (int s = 0; s < dss->Sons (); s++) {
219
219
      CT_PrimDeclSpec *pds = (CT_PrimDeclSpec*)dss->Son (s);
220
220
      if (pds->SpecType () == CT_PrimDeclSpec::PDS_CONST) {
234
234
                << "duplicate `restrict'" << endMessage;
235
235
      }
236
236
    }
237
 
    if (c_count || v_count || r_count)
238
 
      if (is_fct) {
 
237
    if (c_count || v_count || r_count) {
 
238
      if (is_fct || qt) {
239
239
        ((CTypeQualified*)_type)->isConst ((c_count));
240
240
        ((CTypeQualified*)_type)->isVolatile ((v_count));
241
241
        ((CTypeQualified*)_type)->isRestrict ((r_count));
242
 
      } else
 
242
      } else {
243
243
        _type = new CTypeQualified (_type, (c_count), (v_count), (r_count));
 
244
      }
 
245
    }
244
246
  }
245
247
}
246
248