sxemacs
12 years agoCoverity updates/fixes from Nelson
Steve Youngs [Fri, 20 Jan 2012 04:55:22 +0000 (14:55 +1000)]
Coverity updates/fixes from Nelson

* merges: (21 commits)
  Coverity: Missing break: CID 67
  Coverity: Missing break: CID 68
  Coverity: Missing break: CID 69
  Coverity: Missing break: CID 72
  Coverity: Missing break: CID 73
  Coverity: Missing Break: CID 76
  Coverity: Missing lock: CID 81
  Coverity: Missing Lock: CID 82
  Fix build
  Coverity: Negative returns: CID 91
  Coverity: Negative RETURNS: CID 106
  Coverity: Negative returns: CID 107
  Coverity: Negative Returns: CID 121
  Coverity: Reverse INULL: CID 202
  Coverity: Reverse INULL: CID 130
  Coverity: Reverse Negative: CID 210
  Coverity: UNINIT: CID 395
  Coverity: Uninit: CID 396
  Coverity: UNINIT: CID 602
  Coverity: Uninit: CID 603
  ...

12 years agoCoverity: Missing break: CID 67
Nelson Ferreira [Fri, 20 Jan 2012 04:30:08 +0000 (23:30 -0500)]
Coverity: Missing break: CID 67

* src/chartab.c (char_table_type_to_symbol): Add break to account
for fatal crash scenario.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Missing break: CID 68
Nelson Ferreira [Fri, 20 Jan 2012 04:29:29 +0000 (23:29 -0500)]
Coverity: Missing break: CID 68

* src/events/events.c (Fevent_properties): Add break to account
for fatal crash scenario.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Missing break: CID 69
Nelson Ferreira [Fri, 20 Jan 2012 04:28:46 +0000 (23:28 -0500)]
Coverity: Missing break: CID 69

* src/events/events.c (event_equal): Add break to account for
fatal crash scenario.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Missing break: CID 72
Nelson Ferreira [Fri, 20 Jan 2012 04:18:18 +0000 (23:18 -0500)]
Coverity: Missing break: CID 72

* src/mule/file-coding.c (Fcoding_system_type): Add break to
account with fatal crash situation.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Missing break: CID 73
Nelson Ferreira [Fri, 20 Jan 2012 04:17:16 +0000 (23:17 -0500)]
Coverity: Missing break: CID 73

* src/mule/file-coding.c (eol_type_to_symbol): Add break to
account with fatal crash situation.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Missing Break: CID 76
Nelson Ferreira [Fri, 20 Jan 2012 04:15:36 +0000 (23:15 -0500)]
Coverity: Missing Break: CID 76

* src/ui/glyphs.c (Fglyph_type): Add break to account for fatal
crash situation.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Missing lock: CID 81
Nelson Ferreira [Fri, 20 Jan 2012 04:08:10 +0000 (23:08 -0500)]
Coverity: Missing lock: CID 81

* src/semaphore.h (sxe_refcounter_finish): Be "correct" and
pedantic about locking in refcounter_init

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Missing Lock: CID 82
Nelson Ferreira [Fri, 20 Jan 2012 04:07:05 +0000 (23:07 -0500)]
Coverity: Missing Lock: CID 82

* src/semaphore.h (sxe_refcounter_new): Fix the refcounter finish
locking

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoFix build
Nelson Ferreira [Fri, 20 Jan 2012 03:46:00 +0000 (22:46 -0500)]
Fix build

* src/ui/X11/xgccache.c (gc_cache_lookup): Fix build (missing } )

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Negative returns: CID 91
Nelson Ferreira [Fri, 20 Jan 2012 03:43:57 +0000 (22:43 -0500)]
Coverity: Negative returns: CID 91

* lib-src/gnuserv.c (handle_unix_request): Handle error in
accept...

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Negative RETURNS: CID 106
Nelson Ferreira [Fri, 20 Jan 2012 03:42:32 +0000 (22:42 -0500)]
Coverity: Negative RETURNS: CID 106

* src/indent.c (vpix_motion): Try to handle more safely the
crashing fatally scenario...

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Negative returns: CID 107
Nelson Ferreira [Fri, 20 Jan 2012 03:36:59 +0000 (22:36 -0500)]
Coverity: Negative returns: CID 107

* src/dumper.c (pdump): Make sure not to take invalid paths even
when abort is a no-op...

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Negative Returns: CID 121
Nelson Ferreira [Fri, 20 Jan 2012 03:34:49 +0000 (22:34 -0500)]
Coverity: Negative Returns: CID 121

* src/ui/TTY/objects-tty.c (tty_font_spec_matches_charset): Make
sure to abort in case of invariant violation.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Reverse INULL: CID 202
Nelson Ferreira [Fri, 20 Jan 2012 03:26:32 +0000 (22:26 -0500)]
Coverity: Reverse INULL: CID 202

* src/mem/ralloc.c (update_heap_bloc_correspondence): Be extra
safe and do "abort" on violation of stated (in comment) invariant.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Reverse INULL: CID 130
Nelson Ferreira [Fri, 20 Jan 2012 03:22:37 +0000 (22:22 -0500)]
Coverity: Reverse INULL: CID 130

* src/media/sound.c (audio_device_finalise): Do nothing if header is NULL

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Reverse Negative: CID 210
Nelson Ferreira [Fri, 20 Jan 2012 03:19:45 +0000 (22:19 -0500)]
Coverity: Reverse Negative: CID 210

* src/process-unix.c (unix_kill_child_process): Make sure to test
for subtty non negative before calling process_signal_char.

* src/process-unix.c (process_signal_char): Make sure fd is non
negative.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 395
Nelson Ferreira [Fri, 20 Jan 2012 03:10:06 +0000 (22:10 -0500)]
Coverity: UNINIT: CID 395

* src/extents.c (extent_fragment_update): Make sure the glyph_bloc
is initialized.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Uninit: CID 396
Nelson Ferreira [Fri, 20 Jan 2012 03:08:33 +0000 (22:08 -0500)]
Coverity: Uninit: CID 396

* src/fileio.c (file-truename) Make sure path is initialized before use.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 602
Nelson Ferreira [Fri, 20 Jan 2012 02:56:49 +0000 (21:56 -0500)]
Coverity: UNINIT: CID 602

* src/ui/X11/xgccache.c: More UNINIT cleanup

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Uninit: CID 603
Nelson Ferreira [Fri, 20 Jan 2012 02:51:25 +0000 (21:51 -0500)]
Coverity: Uninit: CID 603

* src/ui/lwlib/lwlib-Xaw.c (xaw_generic_callback): Make sure
user_data is either initialized or not used :)

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoFix get_dyna_doc CHAR_IO issue sync
Nelson Ferreira [Fri, 20 Jan 2012 02:44:23 +0000 (21:44 -0500)]
Fix get_dyna_doc CHAR_IO issue sync

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoding style cleanups from Aidan
Steve Youngs [Thu, 19 Jan 2012 01:29:50 +0000 (11:29 +1000)]
Coding style cleanups from Aidan

* from-aidan:
  Improve conformance with usual coding style in effi.c.

12 years agoImprove conformance with usual coding style in effi.c.
Aidan Kehoe [Wed, 18 Jan 2012 12:04:17 +0000 (22:04 +1000)]
Improve conformance with usual coding style in effi.c.

Qabcdef should hold the perfectly normal, interned symbol abcdef, its
C variable should not be named Q_abcdef, that would imply the keyword
:abcdef.

        * effi.c:
        Only declare the symbols corresponding to foreign types if they're
        not declared elsewhere. Follow the usual convention as above.
        * effi.c (FFI_TPTR): Change symbol names here.
        * effi.c (Fffi_basic_type_p): Ditto.
        * effi.c (ffi_canonicalise_type): Ditto.
        * effi.c (Fffi_size_of_type): Ditto.
        * effi.c (Fmake_ffi_object): Ditto.
        * effi.c (Fffi_make_pointer): Ditto.
        * effi.c (Fffi_load_library): Ditto.
        * effi.c (ffi_type_align): Ditto.
        * effi.c (ffi_fetch_foreign): Ditto.
        * effi.c (Fffi_fetch): Ditto.
        * effi.c (Fffi_aref): Ditto.
        * effi.c (Fffi_store): Ditto.
        * effi.c (Fffi_aset): Ditto.
        * effi.c (Fffi_address_of): Ditto.
        * effi.c (Fffi_lisp_object_to_pointer): Ditto.
        * effi.c (extffi_setup_argument): Ditto.
        * effi.c (Fx_device_display): Ditto.
        * effi.c (ffi_callback_call_x86): Ditto.
        * effi.c (Fffi_make_callback): Ditto.
        * effi.c (syms_of_ffi): Use DEFSYMBOL where appropriate, document an
        oddity with Qffiobjectp.
        * general-slots.h: Move Qshort, Qvoid here.
        * lisp.h: Remove Qshort, Qvoid from here.
        * map.c: Ditto.
        * map.c (map_LTX_init): Ditto.
        * mule/file-coding.c: Ditto.
        * mule/file-coding.c (syms_of_file_coding): Ditto.
        * mule/file-coding.h: Ditto.

Signed-off-by: Aidan Kehoe <kehoea@parhasard.net>
Signed-off-by: Steve Youngs <steve@sxemacs.org>
12 years agoCoverity fixes from Nelson
Steve Youngs [Wed, 18 Jan 2012 23:38:10 +0000 (09:38 +1000)]
Coverity fixes from Nelson

* merges:
  Coverity: FORWARD NULL: CID 54, 53, 52
  Coverity: Forward NULL: CID 59, 58, 56
  Coverity: CHAR_IO: CID 5,6,7,9
  Coverity: UNINIT: CID 393
  Coverity: UNINIT: CID 397
  Coverity: UNINIT: CID 398
  Coverity: UNINIT: CID 399
  Coverity: Uninit: CID 400
  Coverity: UNINIT: CID 401
  Fix build
  Fix build
  Coverity: UNINIT: CID 402
  Coverity: UNINIT: CID  403
  Coverity: UNINIT: CID 405, 404
  Coverity: UNUSED: CID 427
  Coverity: Forward NULL: CID 439
  Coverity: UNINIT: CID 599
  Coverity: UNINIT: CID 600
  Coverity: UNINIT: CID 601

12 years agoCoverity: FORWARD NULL: CID 54, 53, 52
Nelson Ferreira [Wed, 18 Jan 2012 20:34:07 +0000 (15:34 -0500)]
Coverity: FORWARD NULL: CID 54, 53, 52

* src/ui/X11/xgccache.c (gc_cache_lookup): Refactor abort() flow
through to shut up coverity.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Forward NULL: CID 59, 58, 56
Nelson Ferreira [Wed, 18 Jan 2012 20:29:11 +0000 (15:29 -0500)]
Coverity: Forward NULL: CID 59, 58, 56

* src/ui/lwlib/lwlib-Xaw.c (xaw_generic_callback): Make sure you
do not dereference possible NULL val.

* src/ui/lwlib/lwlib-Xaw.c (wm_delete_window): Make sure widget
and kids are only used when valid.

* src/ui/lwlib/lwlib.c (replace_widget_value_tree): Make sure node
is only used if != NULL.

* src/ui/lwlib/lwlib.c (lw_map_widget_values): Make sure info is
only used if != NULL.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: CHAR_IO: CID 5,6,7,9
Nelson Ferreira [Wed, 18 Jan 2012 19:51:21 +0000 (14:51 -0500)]
Coverity: CHAR_IO: CID 5,6,7,9

* lib-src/make-docfile.c (skip_white): Use proper return type of getc
* lib-src/make-docfile.c (read_lisp_symbol): Ditto
* src/signal.c (interrupt_signal): Ditto
* lib-src/make-docfile.c (scan_c_file): Do proper casting

* lib-src/make-docfile.c (get_dyna_doc): Let the casting
implementation do the truncation.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoMerge branch 'njsf-cov' into for-steve
Nelson Ferreira [Wed, 18 Jan 2012 18:17:03 +0000 (13:17 -0500)]
Merge branch 'njsf-cov' into for-steve

12 years agoCoverity: UNINIT: CID 393
Nelson Ferreira [Wed, 18 Jan 2012 18:11:14 +0000 (13:11 -0500)]
Coverity: UNINIT: CID 393

* src/print.c (write_string_to_stdio_stream): handle the case
where the transcoding fails.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 397
Nelson Ferreira [Wed, 18 Jan 2012 18:06:23 +0000 (13:06 -0500)]
Coverity: UNINIT: CID 397

* src/buffer.c (directory_is_current_directory): Handle the case
of failed transcoding by attempting to use the non-transcoded
version. There is a high chance it is proper. Worst case it will
also fail, like the bad conversion would have prompted.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 398
Nelson Ferreira [Wed, 18 Jan 2012 18:02:11 +0000 (13:02 -0500)]
Coverity: UNINIT: CID 398

* src/effi.c (Fffi_store): Make sure tmp is only used in the mule
case if transcoding was proper.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 399
Nelson Ferreira [Wed, 18 Jan 2012 18:00:56 +0000 (13:00 -0500)]
Coverity: UNINIT: CID 399

* src/effi.c (Fffi_store): Make sure val_ext is only used if
transcoding was successful.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Uninit: CID 400
Nelson Ferreira [Wed, 18 Jan 2012 17:58:57 +0000 (12:58 -0500)]
Coverity: Uninit: CID 400

* src/emacs.c (decode_path): make sure to return Qnil if
transcoding failed.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 401
Nelson Ferreira [Wed, 18 Jan 2012 17:57:36 +0000 (12:57 -0500)]
Coverity: UNINIT: CID 401

* src/media/media.c (Fmake_media_stream): make sure the stream is
only created if transcoding was ok.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoMerge branch 'njsf-cov' into for-steve
Nelson Ferreira [Wed, 18 Jan 2012 17:51:55 +0000 (12:51 -0500)]
Merge branch 'njsf-cov' into for-steve

12 years agoFix build
Nelson Ferreira [Wed, 18 Jan 2012 17:35:32 +0000 (12:35 -0500)]
Fix build

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoFix build
Nelson Ferreira [Wed, 18 Jan 2012 17:34:57 +0000 (12:34 -0500)]
Fix build

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 402
Nelson Ferreira [Wed, 18 Jan 2012 17:26:44 +0000 (12:26 -0500)]
Coverity: UNINIT: CID 402

* src/print.c (Falternate_debugging_output): Make sure to handle
the case where transcoding failed.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 403
Nelson Ferreira [Wed, 18 Jan 2012 17:23:45 +0000 (12:23 -0500)]
Coverity: UNINIT: CID  403

* src/ui/X11/gui-x.c (button_item_to_widget_value): Make sure
intname is only used if properly transcoded.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 405, 404
Nelson Ferreira [Wed, 18 Jan 2012 17:22:43 +0000 (12:22 -0500)]
Coverity: UNINIT: CID 405, 404

* src/ui/X11/frame-x.c (x_set_frame_properties): Make sure extval
is only used if properly transcoded.

* src/ui/X11/select-x.c (lisp_data_to_selection_data): Ditto.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNUSED: CID 427
Nelson Ferreira [Wed, 18 Jan 2012 17:00:24 +0000 (12:00 -0500)]
Coverity: UNUSED: CID 427

* src/ui/insdel.c (init_buffer_text): Get rid of unused

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Forward NULL: CID 439
Nelson Ferreira [Wed, 18 Jan 2012 16:57:17 +0000 (11:57 -0500)]
Coverity: Forward NULL: CID 439

* src/fns.c (concat): Manually skip and abort when
string_result_ptr is NULL. Coverity is actually right
here, because when we are in a fatal error handling,
assert will be a no-op, so we better just put an
abort for the other cases and not try to dereference...

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 599
Nelson Ferreira [Wed, 18 Jan 2012 16:42:58 +0000 (11:42 -0500)]
Coverity: UNINIT: CID 599

* src/emacs.c (run_emacs_from_temacs): Make sure the arguments
were really transcoded before using them

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 600
Nelson Ferreira [Wed, 18 Jan 2012 16:39:21 +0000 (11:39 -0500)]
Coverity: UNINIT: CID 600

* src/ui/X11/objects-x.c (x_find_charset_font): Make sure intname
is only used if transcoding worked properly.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 601
Nelson Ferreira [Wed, 18 Jan 2012 16:37:32 +0000 (11:37 -0500)]
Coverity: UNINIT: CID 601

* src/ui/glyphs-eimage.c (jpeg_instantiate): Make sure bytes is
only used if properly transcoded.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity fixes from Nelson
Steve Youngs [Sun, 15 Jan 2012 04:52:10 +0000 (14:52 +1000)]
Coverity fixes from Nelson

* merges:
  Add a couple of missing semicolons on last commit
  Fix build
  Add some sanity assertions to format conversions.
  Coverity: UNINIT: CID 409,408,407,406
  Coverity: UNINIT: CID 410
  Coverity: UNREACHABLE: CID 426, 425, 424, 423, 422, 421
  Coverity: UNINIT: CID 453
  Coverity: Uninit: CID 473
  Coverity: Char IO: CID 595
  Coverity: No effect: CID 598
  Coverity: LOCK: CID 597

12 years agoAdd a couple of missing semicolons on last commit
Nelson Ferreira [Sun, 15 Jan 2012 03:48:58 +0000 (22:48 -0500)]
Add a couple of missing semicolons on last commit

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoFix build
Nelson Ferreira [Sun, 15 Jan 2012 03:45:25 +0000 (22:45 -0500)]
Fix build

* src/buffer.h (TO_EXTERNAL_FORMAT): Move assertion up so that
macro can be used as single statement.

* src/buffer.h (TO_INTERNAL_FORMAT): Ditto.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoAdd some sanity assertions to format conversions.
Nelson Ferreira [Sun, 15 Jan 2012 03:32:04 +0000 (22:32 -0500)]
Add some sanity assertions to format conversions.

* src/buffer.h (TO_EXTERNAL_FORMAT): Add additional assert of
validity after conversion.

* src/buffer.h (TO_INTERNAL_FORMAT): Ditto.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 409,408,407,406
Nelson Ferreira [Sun, 15 Jan 2012 03:26:00 +0000 (22:26 -0500)]
Coverity: UNINIT: CID 409,408,407,406

* src/ui/glyphs-eimage.c (rawrgb_instantiate): Only instantiate
image if the data was properly transcoded.

* src/ui/glyphs-eimage.c (png_instantiate): Ditto. In this case,
signal_image_error is best due to complexity.

* src/ui/glyphs-eimage.c (gif_instantiate): Ditto.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 410
Nelson Ferreira [Sun, 15 Jan 2012 03:12:48 +0000 (22:12 -0500)]
Coverity: UNINIT: CID 410

* src/ui/glyphs-eimage.c (rawrgba_instantiate): Make sure data is
only used if conversion was proper.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNREACHABLE: CID 426, 425, 424, 423, 422, 421
Nelson Ferreira [Sun, 15 Jan 2012 03:05:53 +0000 (22:05 -0500)]
Coverity: UNREACHABLE: CID 426, 425, 424, 423, 422, 421

* src/openssl.c (ossl_digest_fun): Just appease Coverity and add
do the while(0)...
* src/openssl.c (ossl_cipher_fun): Ditto.
* src/openssl.c (OSSL_CHECK_PROCESS): Ditto.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 453
Nelson Ferreira [Sun, 15 Jan 2012 02:56:20 +0000 (21:56 -0500)]
Coverity: UNINIT: CID 453

* src/ui/glyphs-eimage.c (tiff_instantiate): Make sure file is
properly encoded before using it. This one is a bit uglier due to
the custom unwind here for error handling.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Uninit: CID 473
Nelson Ferreira [Sun, 15 Jan 2012 02:47:51 +0000 (21:47 -0500)]
Coverity: Uninit: CID 473

* src/media/media-sndfile.c (media_sndfile_open): Make sure to
only call sf_open if file name was properly converted.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Char IO: CID 595
Nelson Ferreira [Sun, 15 Jan 2012 02:43:54 +0000 (21:43 -0500)]
Coverity: Char IO: CID 595

* lib-src/make-docfile.c (get_dyna_doc): Make sure to properly
downcast the result of getc to char, after checking for its
validity (ie != -1).

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: No effect: CID 598
Nelson Ferreira [Sun, 15 Jan 2012 02:37:21 +0000 (21:37 -0500)]
Coverity: No effect: CID 598

* src/media/media-mad.c (media_mad_open): Use long for result of
ftell. Previous use of size_t could cause a bad ftell to be
considered a maximum size media file... Later the positive size has
to be cast to size_t for storage in the structure.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: LOCK: CID 597
Nelson Ferreira [Sun, 15 Jan 2012 02:27:31 +0000 (21:27 -0500)]
Coverity: LOCK: CID 597

* src/media/sound-esd.c (sound_esd_play): Add missing unlock

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoMerge branch 'libsrc-culling'
Steve Youngs [Sun, 15 Jan 2012 02:09:23 +0000 (12:09 +1000)]
Merge branch 'libsrc-culling'

* libsrc-culling:
  Get rid of crusty old stuff from lib-src.

12 years agoGet rid of crusty old stuff from lib-src.
Steve Youngs [Sun, 15 Jan 2012 01:56:36 +0000 (11:56 +1000)]
Get rid of crusty old stuff from lib-src.

We inherited a boat load of stuff in lib-src when we forked from XEmacs,
it's high time we got rid of all that cave-man bit-rot.  This changeset
gets rid of the stuff in lib-src that nobody under the age of 30 has even
heard of, let alone ever used.

* lib-src/Makefile.am (dist_bin_SCRIPTS): Removed.

* lib-src/Makefile.am (dist_archlib_SCRIPTS): Removed.

* lib-src/Makefile.am (stage1): Remove $dist_bin_SCRIPTS.

* etc/Makefile.am (dist_manone_DATA): Remove gnuattach.1,
gnudoit.1.

* etc/gnuserv.1: Remove mention of gnudoit/gnuattach

* lib-src/gnuserv.c (permitted): Don't call it 'gnudoit' in error
string, it's 'gnuclient'.

* lib-src/gnuserv.c (handle_internet_request): Ditto.

* lib-src/gnuclient.c (pass_signal_to_emacs): Call it 'gnuclient'
in error string.

* lisp/gnuserv.el: Remove mention of gnudoit.

* lisp/menubar-items.el (default-menubar): Call it gnuclient for
remote Emacs-W3 entry.

* etc/README: Remove mention of gnudoit, gnuattach

Signed-off-by: Steve Youngs <steve@sxemacs.org>
12 years agoContrib git conveniences from Nelson
Steve Youngs [Sat, 14 Jan 2012 06:35:02 +0000 (16:35 +1000)]
Contrib git conveniences from Nelson

* merges:
  Update README. Give novice advice in git-to-steve.sh
  Add the sample git post-receive hook and update README
  Add clear copyright notices to the scripts I contributed
  Fix build

12 years agoUpdate README. Give novice advice in git-to-steve.sh
Nelson Ferreira [Sat, 14 Jan 2012 05:29:29 +0000 (00:29 -0500)]
Update README. Give novice advice in git-to-steve.sh

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoAdd the sample git post-receive hook and update README
Nelson Ferreira [Sat, 14 Jan 2012 05:04:35 +0000 (00:04 -0500)]
Add the sample git post-receive hook and update README

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoAdd clear copyright notices to the scripts I contributed
Nelson Ferreira [Sat, 14 Jan 2012 04:45:45 +0000 (23:45 -0500)]
Add clear copyright notices to the scripts I contributed

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoMerge branch 'master' of http://git.sxemacs.org/sxemacs into for-steve
Nelson Ferreira [Sat, 14 Jan 2012 01:01:20 +0000 (20:01 -0500)]
Merge branch 'master' of git.sxemacs.org/sxemacs into for-steve

12 years agoMerge branch 'trivial'
Steve Youngs [Sat, 14 Jan 2012 01:00:28 +0000 (11:00 +1000)]
Merge branch 'trivial'

* trivial:
  missing paren

12 years agomissing paren
Steve Youngs [Sat, 14 Jan 2012 01:00:12 +0000 (11:00 +1000)]
missing paren

Signed-off-by: Steve Youngs <steve@sxemacs.org>
12 years agoFix build
Nelson Ferreira [Sat, 14 Jan 2012 00:51:20 +0000 (19:51 -0500)]
Fix build

* src/media/media-sox.c (media_sox_open): Fix stupid typo

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity fixes from Nelson
Steve Youngs [Fri, 13 Jan 2012 23:58:52 +0000 (09:58 +1000)]
Coverity fixes from Nelson

* merges:
  Coverity: UNINIT: CID 474
  Coverity: DEADCODE: CID 578
  Coverity: Checked return: CID 582
  Coverity: Missing lock: CID 584
  Coverity: Negative Returns: CID 585
  Coverity: UNINIT: CID 592
  Coverity: NO_EFFECT: CID 594
  Coverity: UNINIT: CID 593 Make sure file name is not used uninitialized.  : Negative Returns: CID 586: Make sure file size is proper

12 years agoCoverity: UNINIT: CID 474
Nelson Ferreira [Fri, 13 Jan 2012 22:59:37 +0000 (17:59 -0500)]
Coverity: UNINIT: CID 474

* src/media/media-sox.c: make sure file conversion is proper

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: DEADCODE: CID 578
Nelson Ferreira [Fri, 13 Jan 2012 22:56:57 +0000 (17:56 -0500)]
Coverity: DEADCODE: CID 578

* src/print.c (SXE_VSNPRINT_VA): Fix the macro so that error in
snprintf is actually detected, instead of masked because of the
buffer growth loop.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Checked return: CID 582
Nelson Ferreira [Fri, 13 Jan 2012 22:51:16 +0000 (17:51 -0500)]
Coverity: Checked return: CID 582

* src/media/media-internal.c (parsewave): Check the return of
waverequire, because we are trying to align the stream, but it may
still be fatal. Also fix the "flow" through of fatal error parsing
WAVE file in case wvSoundChuck which do not sound proper.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Missing lock: CID 584
Nelson Ferreira [Fri, 13 Jan 2012 22:43:25 +0000 (17:43 -0500)]
Coverity: Missing lock: CID 584

* src/media/sound-esd.c (sound_esd_play): Surround play_state
change with the necessary lock.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Negative Returns: CID 585
Nelson Ferreira [Fri, 13 Jan 2012 22:41:25 +0000 (17:41 -0500)]
Coverity: Negative Returns: CID 585

* src/media/media-internal.c (media_internal_analyse_stream): Only
close the fd if it is valid, ie >= 0.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 592
Nelson Ferreira [Fri, 13 Jan 2012 22:37:14 +0000 (17:37 -0500)]
Coverity: UNINIT: CID 592

* src/media/media-internal.c (media_internal_analyse_stream): Make
sure that only if conversion to external format is successful we
try to open the file otherwise return as if file open failed.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: NO_EFFECT: CID 594
Nelson Ferreira [Fri, 13 Jan 2012 22:24:14 +0000 (17:24 -0500)]
Coverity: NO_EFFECT: CID 594

* lib-src/gnuslib.c (connect_to_unix_server): Use int for sz which
is the proper return type of snprintf.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: UNINIT: CID 593 Make sure file name is not used uninitialized.
Nelson Ferreira [Fri, 13 Jan 2012 22:22:09 +0000 (17:22 -0500)]
Coverity: UNINIT: CID 593 Make sure file name is not used uninitialized.
: Negative Returns: CID 586: Make sure file size is proper

* src/media/media-mad.c (media_mad_open): Guard fopen against bad
EXTERNAL_FORMAT conversion.
Also make sure that if ftell is not successful the function terminates

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: CHAR_IO: CID 595
Nelson Ferreira [Fri, 13 Jan 2012 05:48:40 +0000 (00:48 -0500)]
Coverity: CHAR_IO: CID 595

* lib-src/make-docfile.c (get_dyna_doc): Make explicit the discard
of non existing bits on the getc call assignment to the saved
string.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity fixes from Nelson
Steve Youngs [Thu, 12 Jan 2012 15:38:58 +0000 (01:38 +1000)]
Coverity fixes from Nelson

* merges:
  Coverity: NEGATIVE_RETURNS: CID 588
  Coverity: NULL returns: CID 589
  Coverity: Resource leak: CID 590
  Coverity: Resource leak: CID 591

12 years agoCoverity: NEGATIVE_RETURNS: CID 588
Nelson Ferreira [Thu, 12 Jan 2012 15:23:40 +0000 (10:23 -0500)]
Coverity: NEGATIVE_RETURNS: CID 588

* src/ui/TTY/gpmevent.c (restore_gpm_state): Make sure that fd is
>= 0 before accesing the state array.

* src/ui/TTY/gpmevent.c (store_gpm_state): Ditto.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: NULL returns: CID 589
Nelson Ferreira [Thu, 12 Jan 2012 15:19:15 +0000 (10:19 -0500)]
Coverity: NULL returns: CID 589

* src/process-unix.c (allocate_pty): Make sure slave_name is not
NULL, since that is a possible return from ttyname.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Resource leak: CID 590
Nelson Ferreira [Thu, 12 Jan 2012 15:14:34 +0000 (10:14 -0500)]
Coverity: Resource leak: CID 590

* src/media/media-internal.c (media_internal_analyse_stream): free
data in the case of failed open.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Resource leak: CID 591
Nelson Ferreira [Thu, 12 Jan 2012 15:12:50 +0000 (10:12 -0500)]
Coverity: Resource leak: CID 591

* src/media/media-mad.c (media_mad_open): free sd on unknown driver.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCompiler Warning fixes from Nelson
Steve Youngs [Thu, 12 Jan 2012 14:54:28 +0000 (00:54 +1000)]
Compiler Warning fixes from Nelson

* merges:
  Fix switch warnings in xlwscrollbar
  Fix switch warnings in media
  Remove warnings

12 years agoFix switch warnings in xlwscrollbar
Nelson Ferreira [Thu, 12 Jan 2012 13:29:59 +0000 (08:29 -0500)]
Fix switch warnings in xlwscrollbar

* src/ui/lwlib/xlwscrollbar.c (call_callbacks): Add default to switch.
* src/ui/lwlib/xlwscrollbar.c (timer): Init reason to
XmCR_NONE. Assert that ARM_NONE cannot happen in switch.

* src/ui/lwlib/xlwscrollbar.c (Select): Add fall-through case for
BUTTON_NONE. Add default case for another switch.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoFix switch warnings in media
Nelson Ferreira [Thu, 12 Jan 2012 13:27:26 +0000 (08:27 -0500)]
Fix switch warnings in media

* src/media/media.c: New Qunavailable symbol.

* src/media/media.c (Fmedia_properties): Default driver to
Qunavailable. Add case labels for Xine and Gstreamer.

* src/media/media.c (syms_of_media): init Qunavailable.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoRemove warnings
Nelson Ferreira [Thu, 12 Jan 2012 13:25:00 +0000 (08:25 -0500)]
Remove warnings

* src/regex.c (POP_FAILURE_POINT): Move DEBUG_STATEMENT to comply
with C variable declaration rules. Cast the POP_FAILURE_POINTER return
to proper const-ness.

* src/regex.c (re_match_2_internal): Make re_char *'s d and dend
const. Make scope p2 char* const. Make pdummy and sdummy const.
Remove old comment.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoImproved assertions from Nelson
Steve Youngs [Thu, 12 Jan 2012 05:57:56 +0000 (15:57 +1000)]
Improved assertions from Nelson

* merges:
  Improved assert messages

12 years agoMerge branch 'master' of ssh://dio.dreamhost.com/~/repos.nelsonferreira.com/git/sxema...
Nelson Ferreira [Thu, 12 Jan 2012 05:22:28 +0000 (00:22 -0500)]
Merge branch 'master' of ssh://dio.dreamhost.com/~/repos.nelsonferreira.com/git/sxemacs into for-steve

12 years agoCoverity fixes from Nelson
Steve Youngs [Thu, 12 Jan 2012 05:04:17 +0000 (15:04 +1000)]
Coverity fixes from Nelson

* merges:
  Coverity: Reverse INULL: CID 204
  Coverity: Reverse INULL: CID:207
  Coverity: Reverse Negative: CID:209
  COVERITY: Forward NULL: CID:40
  COVERITY: Forward NULL CID:46
  COVERITY: SECURE_TEMP - CID:345
  Small docstring update

12 years agoMerge branch 'njsf-cov' into for-steve
Nelson Ferreira [Thu, 12 Jan 2012 03:55:56 +0000 (22:55 -0500)]
Merge branch 'njsf-cov' into for-steve

12 years agoCoverity: Reverse INULL: CID 204
Nelson Ferreira [Thu, 12 Jan 2012 03:54:57 +0000 (22:54 -0500)]
Coverity: Reverse INULL: CID 204

* modules/ase/ase-interval.c (_ase_unite_intervals_intr): Defer
the call to ase_cartesion_dimension so that it does not try to
derefence an invalid argument. As a side benefit, it will be
faster in the trivial cases.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Reverse INULL: CID:207
Nelson Ferreira [Thu, 12 Jan 2012 03:52:48 +0000 (22:52 -0500)]
Coverity: Reverse INULL: CID:207

* src/media/media.c (media_stream_finalise): Return immediately if the stream is NULL

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCoverity: Reverse Negative: CID:209
Nelson Ferreira [Thu, 12 Jan 2012 03:51:06 +0000 (22:51 -0500)]
Coverity: Reverse Negative: CID:209

* src/mule/file-coding.c (coding_system_from_mask): Make sure cat
is >=0 before dereferencing in the loop.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCOVERITY: Forward NULL: CID:40
Nelson Ferreira [Thu, 12 Jan 2012 03:46:37 +0000 (22:46 -0500)]
COVERITY: Forward NULL: CID:40

* lib-src/ootags.c (analyse_regex): Return if regex_arg is NULL

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoImproved assert messages
Nelson Ferreira [Thu, 12 Jan 2012 03:38:35 +0000 (22:38 -0500)]
Improved assert messages

* src/emacs.c: make the assertions_dont_abort a variable instead
of define.

* src/emacs.c (assert_failed): Make the 3rd nested assertion abort
instead of exit. Add an extra newline in the 2nd nested
assertion. Add a short backtrace of up to 32767 entries to the 2nd
nested assertion. Add a backtrace to to the 1st assert_failed.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoMerge branch 'master' of ssh://dio.dreamhost.com/~/repos.nelsonferreira.com/git/sxema...
Nelson Ferreira [Thu, 12 Jan 2012 03:25:39 +0000 (22:25 -0500)]
Merge branch 'master' of ssh://dio.dreamhost.com/~/repos.nelsonferreira.com/git/sxemacs into for-steve

12 years agoMerge branch 'njsf-cov' into for-steve
Nelson Ferreira [Thu, 12 Jan 2012 03:25:12 +0000 (22:25 -0500)]
Merge branch 'njsf-cov' into for-steve

12 years agoCOVERITY: Forward NULL CID:46
Nelson Ferreira [Thu, 12 Jan 2012 03:23:56 +0000 (22:23 -0500)]
COVERITY: Forward NULL CID:46

* src/print.c (write_string_to_stdio_stream): Add appropriate
diagnostics if no console nor stream provided...
* src/print.c (Fexternal_debugging_output): Explict NULL
initialization.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
12 years agoCOVERITY: SECURE_TEMP - CID:345
Nelson Ferreira [Thu, 12 Jan 2012 01:57:09 +0000 (20:57 -0500)]
COVERITY: SECURE_TEMP - CID:345

* lib-src/movemail.c (lock_dot): Force umask to a sensible default, ie remove all group and other permissions

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>