[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C++ help needed with new version of phyml



Hi,

Andreas Tille wrote:
> there is a remaining issue:
> lk.c: In function 'Update_PMat_At_Given_Edge':
> lk.c:2263:31: error: invalid initializer
>        int p_matrices[1]     = b_fcus->Pij_rr_idx;

Try

         int p_matrices[1]     = { b_fcus->Pij_rr_idx };


In lk.c there is

  void Update_PMat_At_Given_Edge(t_edge *b_fcus, t_tree *tree)
  {
    ...
      int p_matrices[1]     = b_fcus->Pij_rr_idx;

The definition of type t_edge is in
  https://anonscm.debian.org/cgit/debian-med/phyml.git/tree/src/utilities.h
which has

  typedef struct __Edge {
    ...
  #ifdef BEAGLE
    int                          Pij_rr_idx;
  #endif
    ...
  }t_edge;

So meant is to use scalar value "b_fcus->Pij_rr_idx" as element of the
initializer for the 1-element array "p_matrices".
(I wonder which C compiler lets the programmer get away without using
 braces.)


Have a nice day :)

Thomas


Reply to: