unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: "Jan Djärv" <jan.h.d@swipnet.se>,
	"Emacs development discussions" <emacs-devel@gnu.org>
Subject: Minor nsfont.m fix
Date: Wed, 15 Aug 2012 18:02:46 +0400	[thread overview]
Message-ID: <502BAC06.9000909@yandex.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 104 bytes --]

Since we do not expect NULL from xmalloc and xzalloc, some redundant checks
may be omitted, OK?

Dmitry

[-- Attachment #2: nsfont.patch --]
[-- Type: text/plain, Size: 732 bytes --]

=== modified file 'src/nsfont.m'
--- src/nsfont.m	2012-07-13 18:03:10 +0000
+++ src/nsfont.m	2012-08-15 13:48:52 +0000
@@ -1292,8 +1292,6 @@
 #endif
 
   font_info->glyphs[block] = xmalloc (0x100 * sizeof (unsigned short));
-  if (!unichars || !(font_info->glyphs[block]))
-    abort ();
 
   /* create a string containing all Unicode characters in this block */
   for (idx = block<<8, i = 0; i < 0x100; idx++, i++)
@@ -1367,8 +1365,6 @@
  sfont = [font_info->nsfont screenFont];
 
   font_info->metrics[block] = xzalloc (0x100 * sizeof (struct font_metrics));
-  if (!(font_info->metrics[block]))
-    abort ();
 
   metrics = font_info->metrics[block];
   for (g = block<<8, i =0; i<0x100 && g < numGlyphs; g++, i++, metrics++)


             reply	other threads:[~2012-08-15 14:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-15 14:02 Dmitry Antipov [this message]
2012-08-17  4:37 ` Minor nsfont.m fix Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=502BAC06.9000909@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=jan.h.d@swipnet.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).