Print this page
Code review comments from jeffpc


 820 dump_timestruc(note_state_t *state, const char *title)
 821 {
 822         const sl_timestruc_layout_t *layout = state->ns_arch->timestruc;
 823 
 824         indent_enter(state, title, &layout->tv_sec);
 825 
 826         PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_TV_SEC), tv_sec,
 827             MSG_ORIG(MSG_CNOTE_T_TV_NSEC), tv_nsec);
 828 
 829         indent_exit(state);
 830 }
 831 
 832 /*
 833  * Output information from prsecflags_t structure.
 834  */
 835 static void
 836 dump_secflags(note_state_t *state, const char *title)
 837 {
 838         const sl_prsecflags_layout_t *layout = state->ns_arch->prsecflags;
 839         Conv_secflags_buf_t inv;

 840         Word w;
 841 
 842         indent_enter(state, title, &layout->pr_version);
 843 
 844         w = extract_as_word(state, &layout->pr_version);
 845 
 846         if (w != PRSECFLAGS_VERSION_1) {
 847                 PRINT_DEC(MSG_INTL(MSG_NOTE_BAD_SECFLAGS_VER), pr_version);
 848                 dump_hex_bytes(state->ns_data, state->ns_len, state->ns_indent,
 849                     4, 3);
 850         } else {
 851                 PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_VERSION), pr_version);
 852                 w = extract_as_word(state, &layout->pr_effective);
 853                 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_EFFECTIVE),
 854                     conv_prsecflags(w, 0, &inv));
 855 
 856                 w = extract_as_word(state, &layout->pr_inherit);
 857                 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_INHERIT),
 858                     conv_prsecflags(w, 0, &inv));
 859 
 860                 w = extract_as_word(state, &layout->pr_lower);
 861                 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_LOWER),
 862                     conv_prsecflags(w, 0, &inv));
 863 
 864                 w = extract_as_word(state, &layout->pr_upper);
 865                 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_UPPER),
 866                     conv_prsecflags(w, 0, &inv));
 867         }
 868 
 869         indent_exit(state);
 870 }
 871 
 872 /*
 873  * Output information from utsname structure.
 874  */
 875 static void
 876 dump_utsname(note_state_t *state, const char *title)
 877 {
 878         const sl_utsname_layout_t       *layout = state->ns_arch->utsname;
 879 
 880         indent_enter(state, title, &layout->sysname);
 881 
 882         PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_SYSNAME), sysname);
 883         PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_NODENAME), nodename);
 884         PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_RELEASE), release);
 885         PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_VERSION), version);
 886         PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_MACHINE), machine);




 820 dump_timestruc(note_state_t *state, const char *title)
 821 {
 822         const sl_timestruc_layout_t *layout = state->ns_arch->timestruc;
 823 
 824         indent_enter(state, title, &layout->tv_sec);
 825 
 826         PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_TV_SEC), tv_sec,
 827             MSG_ORIG(MSG_CNOTE_T_TV_NSEC), tv_nsec);
 828 
 829         indent_exit(state);
 830 }
 831 
 832 /*
 833  * Output information from prsecflags_t structure.
 834  */
 835 static void
 836 dump_secflags(note_state_t *state, const char *title)
 837 {
 838         const sl_prsecflags_layout_t *layout = state->ns_arch->prsecflags;
 839         Conv_secflags_buf_t inv;
 840         Lword lw;
 841         Word w;
 842 
 843         indent_enter(state, title, &layout->pr_version);
 844 
 845         w = extract_as_word(state, &layout->pr_version);
 846 
 847         if (w != PRSECFLAGS_VERSION_1) {
 848                 PRINT_DEC(MSG_INTL(MSG_NOTE_BAD_SECFLAGS_VER), pr_version);
 849                 dump_hex_bytes(state->ns_data, state->ns_len, state->ns_indent,
 850                     4, 3);
 851         } else {
 852                 PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_VERSION), pr_version);
 853                 lw = extract_as_lword(state, &layout->pr_effective);
 854                 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_EFFECTIVE),
 855                     conv_prsecflags(lw, 0, &inv));
 856 
 857                 lw = extract_as_lword(state, &layout->pr_inherit);
 858                 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_INHERIT),
 859                     conv_prsecflags(lw, 0, &inv));
 860 
 861                 lw = extract_as_lword(state, &layout->pr_lower);
 862                 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_LOWER),
 863                     conv_prsecflags(lw, 0, &inv));
 864 
 865                 lw = extract_as_lword(state, &layout->pr_upper);
 866                 print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_UPPER),
 867                     conv_prsecflags(lw, 0, &inv));
 868         }
 869 
 870         indent_exit(state);
 871 }
 872 
 873 /*
 874  * Output information from utsname structure.
 875  */
 876 static void
 877 dump_utsname(note_state_t *state, const char *title)
 878 {
 879         const sl_utsname_layout_t       *layout = state->ns_arch->utsname;
 880 
 881         indent_enter(state, title, &layout->sysname);
 882 
 883         PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_SYSNAME), sysname);
 884         PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_NODENAME), nodename);
 885         PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_RELEASE), release);
 886         PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_VERSION), version);
 887         PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_UTS_MACHINE), machine);