Fossil

Check-in [725630f3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Another attempt to fix non-constant format complaint.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | login-on-post
Files: files | file ages | folders
SHA3-256:725630f3f854e3e224836ce4178e6208af3fad33feb9a0b2461b94b647aefc4d
User & Date: wyoung 2018-11-09 19:16:21
Context
2018-11-09
19:18
Merged login-on-post branch to trunk check-in: c0e384cf user: wyoung tags: trunk
19:16
Another attempt to fix non-constant format complaint. Closed-Leaf check-in: 725630f3 user: wyoung tags: login-on-post
19:11
Fix to previous for the "non-constant format" complaint from some compilers. I can't see what they're yelling about, but this fixes it. check-in: 095333fc user: wyoung tags: login-on-post
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/forum.c.

969
970
971
972
973
974
975
976
977
978
979
980
981


982
983
984
985
986
987
988
  login_check_credentials();
  srchFlags = search_restrict(SRCH_FORUM);
  if( !g.perm.RdForum ){
    login_needed(g.anon.RdForum);
    return;
  }
  style_header("Forum");
  {
    /* 2-step split required by some GCCs, which think this first
     * expression "has non-constant format".  Whatever GCC...
     */
    const char* target = g.perm.WrForum ? "%R/forumnew" : "%R/login";
    style_submenu_element("New Thread", target);


  }
  if( g.perm.ModForum && moderation_needed() ){
    style_submenu_element("Moderation Requests", "%R/modreq");
  }
  if( (srchFlags & SRCH_FORUM)!=0 ){
    if( search_screen(SRCH_FORUM, 0) ){
      style_submenu_element("Recent Threads","%R/forum");







|
|
|
|
|
|
>
>







969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
  login_check_credentials();
  srchFlags = search_restrict(SRCH_FORUM);
  if( !g.perm.RdForum ){
    login_needed(g.anon.RdForum);
    return;
  }
  style_header("Forum");
  if( g.perm.WrForum ){
    style_submenu_element("New Thread","%R/forumnew");
  }else{
    /* Can't combine this with previous case using the ternary operator
     * because that causes an error yelling about "non-constant format"
     * with some compilers.  I can't see it, since both expressions have
     * the same format, but I'm no C spec lawyer. */
    style_submenu_element("New Thread","%R/login");
  }
  if( g.perm.ModForum && moderation_needed() ){
    style_submenu_element("Moderation Requests", "%R/modreq");
  }
  if( (srchFlags & SRCH_FORUM)!=0 ){
    if( search_screen(SRCH_FORUM, 0) ){
      style_submenu_element("Recent Threads","%R/forum");