commit 0f1f53a441dacc8d44d3568626bbc96de310c1fd
parent bf1a080923a69192ef7480b4a807f3d9b934c796
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 23 Mar 2018 11:08:04 +0100
tweaks: drop a handful of unhelpful asserts
Diffstat:
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -204,12 +204,7 @@ void renumber(filestruct *line)
partition *partition_filestruct(filestruct *top, size_t top_x,
filestruct *bot, size_t bot_x)
{
- partition *p;
-
- assert(top != NULL && bot != NULL && openfile->fileage != NULL && openfile->filebot != NULL);
-
- /* Initialize the partition. */
- p = (partition *)nmalloc(sizeof(partition));
+ partition *p = nmalloc(sizeof(partition));
/* If the top and bottom of the partition are different from the top
* and bottom of the buffer, save the latter and then set them
@@ -252,8 +247,6 @@ partition *partition_filestruct(filestruct *top, size_t top_x,
* to (filebot, $) again. */
void unpartition_filestruct(partition **p)
{
- assert(p != NULL && openfile->fileage != NULL && openfile->filebot != NULL);
-
/* Reattach the line above the top of the partition, and restore the
* text before top_x from top_data. Free top_data when we're done
* with it. */
@@ -304,8 +297,6 @@ void extract_buffer(filestruct **file_top, filestruct **file_bot,
bool same_line = FALSE;
#endif
- assert(file_top != NULL && file_bot != NULL && top != NULL && bot != NULL);
-
/* If (top, top_x)-(bot, bot_x) doesn't cover any text, get out. */
if (top == bot && top_x == bot_x)
return;
@@ -417,8 +408,6 @@ void ingraft_buffer(filestruct *somebuffer)
bool right_side_up = FALSE, single_line = FALSE;
#endif
- assert(somebuffer != NULL);
-
#ifndef NANO_TINY
/* Keep track of whether the mark begins inside the partition and
* will need adjustment. */
@@ -516,8 +505,6 @@ openfilestruct *make_new_opennode(void)
/* Unlink a node from the rest of the circular list, and delete it. */
void unlink_opennode(openfilestruct *fileptr)
{
- assert(fileptr != fileptr->prev && fileptr != fileptr->next);
-
#ifdef ENABLE_MULTIBUFFER
if (fileptr == firstfile)
firstfile = firstfile->next;