dthelp: Change to ANSI function definitions
[oweals/cde.git] / cde / programs / dtmail / dtmail / MsgScrollingList.C
index d5e5f2306cf1384c3f0dad57f913424806149562..b8b58aac1a83736ce41546c0b1143980ff30072a 100644 (file)
@@ -16,7 +16,7 @@
  * details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * License along with these libraries and programs; if not, write
  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  * Floor, Boston, MA 02110-1301 USA
  */
@@ -65,7 +65,7 @@
 
 #include <X11/IntrinsicP.h> // Include for moving X location of titles
 
-extern force( Widget );
+extern int force( Widget );
 
 MsgScrollingList::MsgScrollingList(
     RoamMenuWindow *menuwindow,
@@ -698,12 +698,12 @@ void MsgScrollingList::do_list_vis_adjustment()
         if (winM <= 0) { //[There is no scope of adjustment
             return;
         }
-        //[All the new messages can be accomodated w/o scrolling curr selection
+        //[All the new messages can be accommodated w/o scrolling curr selection
         if (numNew <= winM) {
             XmListSetBottomPos(list, cItmCnt);
             return;
         }
-        //[All the new messages cannot be accomodated, but we will do best fit
+        //[All the new messages cannot be accommodated, but we will do best fit
         else {
             int numNotShow = numNew - winM;
             XmListSetBottomPos(list, cItmCnt - numNotShow);
@@ -2414,7 +2414,7 @@ MsgScrollingList::updateListItems(int current,
 
     nmsgs = _msgs->length();
     newList = new XmString[nmsgs];
-    memset (newList, '0', nmsgs * sizeof (XmString *));
+    memset (newList, 0, nmsgs * sizeof (XmString *));
 
     // Loop through _msgs and create new strings to display in the
     // scrolling list. This is inefficient and dominates the time
@@ -2436,7 +2436,7 @@ MsgScrollingList::updateListItems(int current,
          fprintf(stderr,
           "dtmail: getMessageSummary: Couldn't get summary for msg # %d\n", m);
 
-       if ((msg == NULL) || (mbox == NULL))
+       if (msg == NULL)
        {
                // Error
                ;
@@ -2608,7 +2608,9 @@ MsgScrollingList::formatHeader(DtMailHeaderLine & info,
     {
        DtMailValueDate ds = ((info.header_values[1])[0])->toDate();
 
-       if (ds.dtm_date && ds.dtm_tz_offset_secs)
+#define USE_MAX_TZ_SECONDS     (60 * 60 * 12)
+       if (ds.dtm_date && ds.dtm_tz_offset_secs >= -USE_MAX_TZ_SECONDS
+                       && ds.dtm_tz_offset_secs <=  USE_MAX_TZ_SECONDS)
        {
 #define USE_YEAR_FORMAT_SECONDS        (60 * 60 * 24 * 180)
            time_t now;