Skip to content

Commit

Permalink
Merge pull request #564 from MethodicalAcceleratorDesign/ld-dev
Browse files Browse the repository at this point in the history
Ld dev
  • Loading branch information
madcern committed Feb 13, 2018
2 parents fd9d881 + 83589cf commit 1674e30
Show file tree
Hide file tree
Showing 116 changed files with 246,045 additions and 245,767 deletions.
4 changes: 4 additions & 0 deletions src/emit.f90
Expand Up @@ -514,6 +514,10 @@ subroutine emdamp(code, deltap, em1, em2, orb1, orb2, re)
NORMAL(0:maxmul) = zero ; call get_node_vector('knl ',nn,normal)
SKEW(0:maxmul) = zero ; call get_node_vector('ksl ',ns,skew)

!---- Angle (bvk applied later)
an = node_value('angle ')
if (an .ne. 0) f_errors(0) = f_errors(0) + normal(0) - an

!---- Other components and errors.
nord = 0
do i = 0, max(nn, ns, n_ferr/2-1)
Expand Down
4 changes: 2 additions & 2 deletions src/mad_6track.c
Expand Up @@ -2311,7 +2311,7 @@ pre_multipole(struct c6t_element* el) /* pre-process multipoles */
if (++last_nzero > el->nf_err)
{
if (el->p_fd_err != NULL) strcpy(tmp_name, el->p_fd_err->key);
else sprintf(tmp_name,"%s_arfa", el->name);
else snprintf(tmp_name, sizeof tmp_name, "%.42s_arfa", el->name);
el->nf_err = last_nzero;
el->p_fd_err = make_obj(tmp_name, 0, el->nf_err, 0, 0);
}
Expand Down Expand Up @@ -2359,7 +2359,7 @@ pro_elem(struct node* cnode)
current_element->occ_cnt = cnode->occ_cnt;
if (cnode->occ_cnt > 1) /* add occurence count to name */
{
sprintf(t_key, "%s+%d", current_element->name,cnode->occ_cnt);
snprintf(t_key, sizeof t_key, "%.45s+%d", current_element->name,cnode->occ_cnt);
strcpy(current_element->name, t_key);
}
current_element->position = cnode->position;
Expand Down
19 changes: 10 additions & 9 deletions src/mad_cmdpar.c
Expand Up @@ -10,27 +10,28 @@ clone_command_parameter(const struct command_parameter* p)
clone->call_def = p->call_def;
switch (p->type)
{
case 4:
case 4: // constraint
clone->c_min = p->c_min;
clone->c_max = p->c_max;
clone->min_expr = clone_expression(p->min_expr);
clone->max_expr = clone_expression(p->max_expr);
case 0:
case 1:
case 2:
__attribute__ ((fallthrough));
case 0: // logical (not supported...)
case 1: // integer (not supported...)
case 2: // double
clone->double_value = p->double_value;
clone->expr = clone_expression(p->expr);
break;
case 3:
case 3: // string
clone->string = permbuff(p->string);
clone->expr = NULL;
break;
case 11:
case 12:
case 11: // array of integers (not supported...)
case 12: // array if doubles
clone->double_array = clone_double_array(p->double_array);
clone->expr_list = clone_expr_list(p->expr_list);
break;
case 13:
case 13: // array of strings
clone->m_string = clone_char_p_array(p->m_string);
}
return clone;
Expand Down Expand Up @@ -392,7 +393,7 @@ command_par_value_user2(const char* parameter, const struct command* cmd, double
else
{
*val = 0;
}
}
return inf;
}

Expand Down
1 change: 1 addition & 0 deletions src/mad_const.c
Expand Up @@ -38,6 +38,7 @@ make_constraint(int find_npos, struct command_parameter* par)
new->ex_c_min = par->min_expr;
}
if (par->c_type == 1) break;
__attribute__ ((fallthrough));
case 2: /* maximum */
if (par->max_expr == NULL) new->c_max = par->c_max;
else
Expand Down

0 comments on commit 1674e30

Please sign in to comment.